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>
This commit is contained in:
Kirti Wankhede 2020-10-26 15:06:21 +05:30 committed by Alex Williamson
parent 74ee653799
commit 87ea529c50
3 changed files with 91 additions and 9 deletions

View file

@ -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);