aboutsummaryrefslogtreecommitdiff
path: root/include/hw/vfio
diff options
context:
space:
mode:
authorKirti Wankhede <kwankhede@nvidia.com>2020-10-26 15:06:14 +0530
committerAlex Williamson <alex.williamson@redhat.com>2020-11-01 12:30:50 -0700
commita9e271ec9b36ef4c7b5bc3b234c85d93931e192e (patch)
treeb58e46baa6957b6fb2547d731d285f385b1d8583 /include/hw/vfio
parentc5e2fb3ce4dbb158732420fbd3b963eebbcd85c8 (diff)
downloadqemu-a9e271ec9b36ef4c7b5bc3b234c85d93931e192e.zip
qemu-a9e271ec9b36ef4c7b5bc3b234c85d93931e192e.tar.gz
qemu-a9e271ec9b36ef4c7b5bc3b234c85d93931e192e.tar.bz2
vfio: Add migration region initialization and finalize function
Whether the VFIO device supports migration or not is decided based of migration region query. If migration region query is successful and migration region initialization is successful then migration is supported else migration is blocked. Signed-off-by: Kirti Wankhede <kwankhede@nvidia.com> Reviewed-by: Neo Jia <cjia@nvidia.com> Acked-by: Dr. David Alan Gilbert <dgilbert@redhat.com> Reviewed-by: Cornelia Huck <cohuck@redhat.com> Signed-off-by: Alex Williamson <alex.williamson@redhat.com>
Diffstat (limited to 'include/hw/vfio')
-rw-r--r--include/hw/vfio/vfio-common.h9
1 files changed, 9 insertions, 0 deletions
diff --git a/include/hw/vfio/vfio-common.h b/include/hw/vfio/vfio-common.h
index ba6169c..8275c4c 100644
--- a/include/hw/vfio/vfio-common.h
+++ b/include/hw/vfio/vfio-common.h
@@ -57,6 +57,10 @@ typedef struct VFIORegion {
uint8_t nr; /* cache the region number for debug */
} VFIORegion;
+typedef struct VFIOMigration {
+ VFIORegion region;
+} VFIOMigration;
+
typedef struct VFIOAddressSpace {
AddressSpace *as;
QLIST_HEAD(, VFIOContainer) containers;
@@ -113,6 +117,8 @@ typedef struct VFIODevice {
unsigned int num_irqs;
unsigned int num_regions;
unsigned int flags;
+ VFIOMigration *migration;
+ Error *migration_blocker;
} VFIODevice;
struct VFIODeviceOps {
@@ -204,4 +210,7 @@ int vfio_spapr_create_window(VFIOContainer *container,
int vfio_spapr_remove_window(VFIOContainer *container,
hwaddr offset_within_address_space);
+int vfio_migration_probe(VFIODevice *vbasedev, Error **errp);
+void vfio_migration_finalize(VFIODevice *vbasedev);
+
#endif /* HW_VFIO_VFIO_COMMON_H */