diff options
| author | Mark Cave-Ayland <mark.caveayland@nutanix.com> | 2025-07-15 10:25:52 +0100 |
|---|---|---|
| committer | Cédric Le Goater <clg@redhat.com> | 2025-09-08 16:46:31 +0200 |
| commit | 5d1219e358a559680fdc34b112e2b04806f5ff62 (patch) | |
| tree | 0e329807397547b263f839dca6550ad3df3e1a45 | |
| parent | b458e9e9e4c171622f19df18f5363c7ef4e8697f (diff) | |
| download | focaccia-qemu-5d1219e358a559680fdc34b112e2b04806f5ff62.tar.gz focaccia-qemu-5d1219e358a559680fdc34b112e2b04806f5ff62.zip | |
vfio-user/pci.c: use QOM casts where appropriate
Use QOM casts to convert between VFIOUserPCIDevice and VFIOPCIDevice instead of accessing device directly. Signed-off-by: Mark Cave-Ayland <mark.caveayland@nutanix.com> Reviewed-by: John Levon <john.levon@nutanix.com> Link: https://lore.kernel.org/qemu-devel/20250715093110.107317-13-mark.caveayland@nutanix.com Signed-off-by: Cédric Le Goater <clg@redhat.com>
| -rw-r--r-- | hw/vfio-user/pci.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/hw/vfio-user/pci.c b/hw/vfio-user/pci.c index 29cb592e9c..7b6a6514f6 100644 --- a/hw/vfio-user/pci.c +++ b/hw/vfio-user/pci.c @@ -214,8 +214,9 @@ static void vfio_user_compute_needs_reset(VFIODevice *vbasedev) static Object *vfio_user_pci_get_object(VFIODevice *vbasedev) { - VFIOUserPCIDevice *vdev = container_of(vbasedev, VFIOUserPCIDevice, - device.vbasedev); + VFIOUserPCIDevice *vdev = VFIO_USER_PCI(container_of(vbasedev, + VFIOPCIDevice, + vbasedev)); return OBJECT(vdev); } @@ -420,7 +421,7 @@ static void vfio_user_pci_set_socket(Object *obj, Visitor *v, const char *name, VFIOUserPCIDevice *udev = VFIO_USER_PCI(obj); bool success; - if (udev->device.vbasedev.proxy) { + if (VFIO_PCI_BASE(udev)->vbasedev.proxy) { error_setg(errp, "Proxy is connected"); return; } |