aboutsummaryrefslogtreecommitdiff
path: root/hw/vfio/migration.c
diff options
context:
space:
mode:
authorKirti Wankhede <kwankhede@nvidia.com>2020-10-26 15:06:21 +0530
committerAlex Williamson <alex.williamson@redhat.com>2020-11-01 12:30:50 -0700
commit87ea529c5020124440cd892a038dffe6057fd613 (patch)
tree31dc479983a101aa36978d63ec9d08854e7a38e0 /hw/vfio/migration.c
parent74ee653799f93dfb119de9a248bdf0a85a68904f (diff)
vfio: Get migration capability flags for container
Added helper functions to get IOMMU info capability chain. Added function to get migration capability information from that capability chain for IOMMU container. Similar change was proposed earlier: https://lists.gnu.org/archive/html/qemu-devel/2018-05/msg03759.html Disable migration for devices if IOMMU module doesn't support migration capability. Signed-off-by: Kirti Wankhede <kwankhede@nvidia.com> Cc: Shameer Kolothum <shameerali.kolothum.thodi@huawei.com> Cc: Eric Auger <eric.auger@redhat.com> Signed-off-by: Alex Williamson <alex.williamson@redhat.com>
Diffstat (limited to 'hw/vfio/migration.c')
-rw-r--r--hw/vfio/migration.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/hw/vfio/migration.c b/hw/vfio/migration.c
index 1af0fce874..39503b49e3 100644
--- a/hw/vfio/migration.c
+++ b/hw/vfio/migration.c
@@ -832,9 +832,14 @@ err:
int vfio_migration_probe(VFIODevice *vbasedev, Error **errp)
{
+ VFIOContainer *container = vbasedev->group->container;
struct vfio_region_info *info = NULL;
Error *local_err = NULL;
- int ret;
+ int ret = -ENOTSUP;
+
+ if (!container->dirty_pages_supported) {
+ goto add_blocker;
+ }
ret = vfio_get_dev_region_info(vbasedev, VFIO_REGION_TYPE_MIGRATION,
VFIO_REGION_SUBTYPE_MIGRATION, &info);