[PATCH 22/22] vfio/pci.h: rename VFIOPCIDevice pdev field to parent_obj

Mark Cave-Ayland posted 22 patches 4 months ago
Maintainers: Nicholas Piggin <npiggin@gmail.com>, Daniel Henrique Barboza <danielhb413@gmail.com>, Harsh Prateek Bora <harshpb@linux.ibm.com>, Matthew Rosato <mjrosato@linux.ibm.com>, Eric Farman <farman@linux.ibm.com>, Richard Henderson <richard.henderson@linaro.org>, David Hildenbrand <david@redhat.com>, Ilya Leoshkevich <iii@linux.ibm.com>, Thomas Huth <thuth@redhat.com>, Halil Pasic <pasic@linux.ibm.com>, Christian Borntraeger <borntraeger@linux.ibm.com>, John Levon <john.levon@nutanix.com>, Thanos Makatos <thanos.makatos@nutanix.com>, Alex Williamson <alex.williamson@redhat.com>, "Cédric Le Goater" <clg@redhat.com>, Steve Sistare <steven.sistare@oracle.com>, Tomita Moeko <tomitamoeko@gmail.com>
[PATCH 22/22] vfio/pci.h: rename VFIOPCIDevice pdev field to parent_obj
Posted by Mark Cave-Ayland 4 months ago
Now that nothing accesses the pdev field directly, rename pdev to
parent_obj as per our current coding guidelines.

Signed-off-by: Mark Cave-Ayland <mark.caveayland@nutanix.com>
---
 hw/vfio/cpr.c | 4 ++--
 hw/vfio/pci.c | 4 ++--
 hw/vfio/pci.h | 2 +-
 3 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/hw/vfio/cpr.c b/hw/vfio/cpr.c
index 3e3f4035ab..366490c908 100644
--- a/hw/vfio/cpr.c
+++ b/hw/vfio/cpr.c
@@ -171,8 +171,8 @@ const VMStateDescription vfio_cpr_pci_vmstate = {
     .post_load = vfio_cpr_pci_post_load,
     .needed = cpr_incoming_needed,
     .fields = (VMStateField[]) {
-        VMSTATE_PCI_DEVICE(pdev, VFIOPCIDevice),
-        VMSTATE_MSIX_TEST(pdev, VFIOPCIDevice, pci_msix_present),
+        VMSTATE_PCI_DEVICE(parent_obj, VFIOPCIDevice),
+        VMSTATE_MSIX_TEST(parent_obj, VFIOPCIDevice, pci_msix_present),
         VMSTATE_VFIO_INTX(intx, VFIOPCIDevice),
         VMSTATE_END_OF_LIST()
     }
diff --git a/hw/vfio/pci.c b/hw/vfio/pci.c
index fb9eb58da5..1db6be8f21 100644
--- a/hw/vfio/pci.c
+++ b/hw/vfio/pci.c
@@ -2804,8 +2804,8 @@ static const VMStateDescription vmstate_vfio_pci_config = {
     .version_id = 1,
     .minimum_version_id = 1,
     .fields = (const VMStateField[]) {
-        VMSTATE_PCI_DEVICE(pdev, VFIOPCIDevice),
-        VMSTATE_MSIX_TEST(pdev, VFIOPCIDevice, vfio_msix_present),
+        VMSTATE_PCI_DEVICE(parent_obj, VFIOPCIDevice),
+        VMSTATE_MSIX_TEST(parent_obj, VFIOPCIDevice, vfio_msix_present),
         VMSTATE_END_OF_LIST()
     },
     .subsections = (const VMStateDescription * const []) {
diff --git a/hw/vfio/pci.h b/hw/vfio/pci.h
index c0c3d68742..37d8b996f5 100644
--- a/hw/vfio/pci.h
+++ b/hw/vfio/pci.h
@@ -131,7 +131,7 @@ OBJECT_DECLARE_SIMPLE_TYPE(VFIOPCIDevice, VFIO_PCI_BASE)
 /* TYPE_VFIO_PCI shares struct VFIOPCIDevice. */
 
 struct VFIOPCIDevice {
-    PCIDevice pdev;
+    PCIDevice parent_obj;
 
     VFIODevice vbasedev;
     VFIOINTx intx;
-- 
2.43.0
Re: [PATCH 22/22] vfio/pci.h: rename VFIOPCIDevice pdev field to parent_obj
Posted by Cédric Le Goater 3 months ago
On 7/15/25 11:26, Mark Cave-Ayland wrote:
> Now that nothing accesses the pdev field directly, rename pdev to
> parent_obj as per our current coding guidelines.
> 
> Signed-off-by: Mark Cave-Ayland <mark.caveayland@nutanix.com>


Reviewed-by: Cédric Le Goater <clg@redhat.com>

Thanks,

C.


> ---
>   hw/vfio/cpr.c | 4 ++--
>   hw/vfio/pci.c | 4 ++--
>   hw/vfio/pci.h | 2 +-
>   3 files changed, 5 insertions(+), 5 deletions(-)
> 
> diff --git a/hw/vfio/cpr.c b/hw/vfio/cpr.c
> index 3e3f4035ab..366490c908 100644
> --- a/hw/vfio/cpr.c
> +++ b/hw/vfio/cpr.c
> @@ -171,8 +171,8 @@ const VMStateDescription vfio_cpr_pci_vmstate = {
>       .post_load = vfio_cpr_pci_post_load,
>       .needed = cpr_incoming_needed,
>       .fields = (VMStateField[]) {
> -        VMSTATE_PCI_DEVICE(pdev, VFIOPCIDevice),
> -        VMSTATE_MSIX_TEST(pdev, VFIOPCIDevice, pci_msix_present),
> +        VMSTATE_PCI_DEVICE(parent_obj, VFIOPCIDevice),
> +        VMSTATE_MSIX_TEST(parent_obj, VFIOPCIDevice, pci_msix_present),
>           VMSTATE_VFIO_INTX(intx, VFIOPCIDevice),
>           VMSTATE_END_OF_LIST()
>       }
> diff --git a/hw/vfio/pci.c b/hw/vfio/pci.c
> index fb9eb58da5..1db6be8f21 100644
> --- a/hw/vfio/pci.c
> +++ b/hw/vfio/pci.c
> @@ -2804,8 +2804,8 @@ static const VMStateDescription vmstate_vfio_pci_config = {
>       .version_id = 1,
>       .minimum_version_id = 1,
>       .fields = (const VMStateField[]) {
> -        VMSTATE_PCI_DEVICE(pdev, VFIOPCIDevice),
> -        VMSTATE_MSIX_TEST(pdev, VFIOPCIDevice, vfio_msix_present),
> +        VMSTATE_PCI_DEVICE(parent_obj, VFIOPCIDevice),
> +        VMSTATE_MSIX_TEST(parent_obj, VFIOPCIDevice, vfio_msix_present),
>           VMSTATE_END_OF_LIST()
>       },
>       .subsections = (const VMStateDescription * const []) {
> diff --git a/hw/vfio/pci.h b/hw/vfio/pci.h
> index c0c3d68742..37d8b996f5 100644
> --- a/hw/vfio/pci.h
> +++ b/hw/vfio/pci.h
> @@ -131,7 +131,7 @@ OBJECT_DECLARE_SIMPLE_TYPE(VFIOPCIDevice, VFIO_PCI_BASE)
>   /* TYPE_VFIO_PCI shares struct VFIOPCIDevice. */
>   
>   struct VFIOPCIDevice {
> -    PCIDevice pdev;
> +    PCIDevice parent_obj;
>   
>       VFIODevice vbasedev;
>       VFIOINTx intx;


Re: [PATCH 22/22] vfio/pci.h: rename VFIOPCIDevice pdev field to parent_obj
Posted by Steven Sistare 4 months ago
On 7/15/2025 5:26 AM, Mark Cave-Ayland wrote:
> Now that nothing accesses the pdev field directly, rename pdev to
> parent_obj as per our current coding guidelines.
> 
> Signed-off-by: Mark Cave-Ayland <mark.caveayland@nutanix.com>

Reviewed-by: Steve Sistare <steven.sistare@oracle.com>
Re: [PATCH 22/22] vfio/pci.h: rename VFIOPCIDevice pdev field to parent_obj
Posted by Philippe Mathieu-Daudé 4 months ago
On 15/7/25 11:26, Mark Cave-Ayland wrote:
> Now that nothing accesses the pdev field directly, rename pdev to
> parent_obj as per our current coding guidelines.
> 
> Signed-off-by: Mark Cave-Ayland <mark.caveayland@nutanix.com>
> ---
>   hw/vfio/cpr.c | 4 ++--
>   hw/vfio/pci.c | 4 ++--
>   hw/vfio/pci.h | 2 +-
>   3 files changed, 5 insertions(+), 5 deletions(-)

Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>