Hi Thanos, On 10/2/20 2:54 PM, Thanos Makatos wrote: > According to linux/include/uapi/linux/vfio.h, for a device to support > migration > it must provide a VFIO capability of type VFIO_REGION_INFO_CAP_TYPE and set > .type/.subtype to VFIO_REGION_TYPE_MIGRATION/VFIO_REGION_TYPE_MIGRATION. > > What confuses me is the following: > > "The structure vfio_device_migration_info is placed at the 0th offset of > the VFIO_REGION_SUBTYPE_MIGRATION region to get and set VFIO device related > migration information." > > Where do regions VFIO_REGION_TYPE_MIGRATION and VFIO_REGION_SUBTYPE_MIGRATION > live on the device's address space? Is just like any other region, except that > in the case of a PCI device it's index must be equal to, or larger than, > VFIO_PCI_NUM_REGIONS, and set arbitrarily by the device implementation? If > so, then I suppose this index must appear in struct > vfio_device_info.num_regions?
You need to call VFIO_DEVICE_GET_REGION_INFO with the region type/subtype. The index of the region is stored in struct vfio_region_info index. Thanks Eric > > > _______________________________________________ > vfio-users mailing list > vfio-users@redhat.com > https://www.redhat.com/mailman/listinfo/vfio-users > _______________________________________________ vfio-users mailing list vfio-users@redhat.com https://www.redhat.com/mailman/listinfo/vfio-users