[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH v8 03/13] vfio: Add vfio_get_object callback to VFIO
From: |
Kirti Wankhede |
Subject: |
[Qemu-devel] [PATCH v8 03/13] vfio: Add vfio_get_object callback to VFIODeviceOps |
Date: |
Tue, 27 Aug 2019 00:25:43 +0530 |
Hook vfio_get_object callback for PCI devices.
Signed-off-by: Kirti Wankhede <address@hidden>
Reviewed-by: Neo Jia <address@hidden>
Suggested-by: Cornelia Huck <address@hidden>
Reviewed-by: Cornelia Huck <address@hidden>
---
hw/vfio/pci.c | 8 ++++++++
include/hw/vfio/vfio-common.h | 1 +
2 files changed, 9 insertions(+)
diff --git a/hw/vfio/pci.c b/hw/vfio/pci.c
index dc3479c374e3..56166cae824f 100644
--- a/hw/vfio/pci.c
+++ b/hw/vfio/pci.c
@@ -2393,10 +2393,18 @@ static void vfio_pci_compute_needs_reset(VFIODevice
*vbasedev)
}
}
+static Object *vfio_pci_get_object(VFIODevice *vbasedev)
+{
+ VFIOPCIDevice *vdev = container_of(vbasedev, VFIOPCIDevice, vbasedev);
+
+ return OBJECT(vdev);
+}
+
static VFIODeviceOps vfio_pci_ops = {
.vfio_compute_needs_reset = vfio_pci_compute_needs_reset,
.vfio_hot_reset_multi = vfio_pci_hot_reset_multi,
.vfio_eoi = vfio_intx_eoi,
+ .vfio_get_object = vfio_pci_get_object,
};
int vfio_populate_vga(VFIOPCIDevice *vdev, Error **errp)
diff --git a/include/hw/vfio/vfio-common.h b/include/hw/vfio/vfio-common.h
index 93493891ba40..771b6d59a3db 100644
--- a/include/hw/vfio/vfio-common.h
+++ b/include/hw/vfio/vfio-common.h
@@ -119,6 +119,7 @@ struct VFIODeviceOps {
void (*vfio_compute_needs_reset)(VFIODevice *vdev);
int (*vfio_hot_reset_multi)(VFIODevice *vdev);
void (*vfio_eoi)(VFIODevice *vdev);
+ Object *(*vfio_get_object)(VFIODevice *vdev);
};
typedef struct VFIOGroup {
--
2.7.0
- [Qemu-devel] [PATCH v8 00/13] Add migration support for VFIO device, Kirti Wankhede, 2019/08/26
- [Qemu-devel] [PATCH v8 01/13] vfio: KABI for migration interface, Kirti Wankhede, 2019/08/26
- [Qemu-devel] [PATCH v8 02/13] vfio: Add function to unmap VFIO region, Kirti Wankhede, 2019/08/26
- [Qemu-devel] [PATCH v8 03/13] vfio: Add vfio_get_object callback to VFIODeviceOps,
Kirti Wankhede <=
- [Qemu-devel] [PATCH v8 04/13] vfio: Add save and load functions for VFIO PCI devices, Kirti Wankhede, 2019/08/26
- [Qemu-devel] [PATCH v8 05/13] vfio: Add migration region initialization and finalize function, Kirti Wankhede, 2019/08/26
- [Qemu-devel] [PATCH v8 06/13] vfio: Add VM state change handler to know state of VM, Kirti Wankhede, 2019/08/26
- [Qemu-devel] [PATCH v8 07/13] vfio: Add migration state change notifier, Kirti Wankhede, 2019/08/26
- [Qemu-devel] [PATCH v8 08/13] vfio: Register SaveVMHandlers for VFIO device, Kirti Wankhede, 2019/08/26
- [Qemu-devel] [PATCH v8 09/13] vfio: Add save state functions to SaveVMHandlers, Kirti Wankhede, 2019/08/26
- [Qemu-devel] [PATCH v8 10/13] vfio: Add load state functions to SaveVMHandlers, Kirti Wankhede, 2019/08/26
- [Qemu-devel] [PATCH v8 11/13] vfio: Add function to get dirty page list, Kirti Wankhede, 2019/08/26
- [Qemu-devel] [PATCH v8 12/13] vfio: Add vfio_listener_log_sync to mark dirty pages, Kirti Wankhede, 2019/08/26
- [Qemu-devel] [PATCH v8 13/13] vfio: Make vfio-pci device migration capable., Kirti Wankhede, 2019/08/26