vfio: Change default dirty pages tracking behavior during migration
By default dirty pages tracking is enabled during iterative phase (pre-copy phase). Added per device opt-out option 'x-pre-copy-dirty-page-tracking' to disable dirty pages tracking during iterative phase. If the option 'x-pre-copy-dirty-page-tracking=off' is set for any VFIO device, dirty pages tracking during iterative phase will be disabled. Signed-off-by: Kirti Wankhede <kwankhede@nvidia.com> Signed-off-by: Alex Williamson <alex.williamson@redhat.com>
This commit is contained in:
parent
cf254988a5
commit
bb0990d174
@ -311,7 +311,7 @@ bool vfio_mig_active(void)
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
static bool vfio_devices_all_stopped_and_saving(VFIOContainer *container)
|
static bool vfio_devices_all_saving(VFIOContainer *container)
|
||||||
{
|
{
|
||||||
VFIOGroup *group;
|
VFIOGroup *group;
|
||||||
VFIODevice *vbasedev;
|
VFIODevice *vbasedev;
|
||||||
@ -329,8 +329,11 @@ static bool vfio_devices_all_stopped_and_saving(VFIOContainer *container)
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((migration->device_state & VFIO_DEVICE_STATE_SAVING) &&
|
if (migration->device_state & VFIO_DEVICE_STATE_SAVING) {
|
||||||
!(migration->device_state & VFIO_DEVICE_STATE_RUNNING)) {
|
if ((vbasedev->pre_copy_dirty_page_tracking == ON_OFF_AUTO_OFF)
|
||||||
|
&& (migration->device_state & VFIO_DEVICE_STATE_RUNNING)) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
continue;
|
continue;
|
||||||
} else {
|
} else {
|
||||||
return false;
|
return false;
|
||||||
@ -1125,7 +1128,7 @@ static void vfio_listerner_log_sync(MemoryListener *listener,
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (vfio_devices_all_stopped_and_saving(container)) {
|
if (vfio_devices_all_saving(container)) {
|
||||||
vfio_sync_dirty_bitmap(container, section);
|
vfio_sync_dirty_bitmap(container, section);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -3182,6 +3182,9 @@ static void vfio_instance_init(Object *obj)
|
|||||||
static Property vfio_pci_dev_properties[] = {
|
static Property vfio_pci_dev_properties[] = {
|
||||||
DEFINE_PROP_PCI_HOST_DEVADDR("host", VFIOPCIDevice, host),
|
DEFINE_PROP_PCI_HOST_DEVADDR("host", VFIOPCIDevice, host),
|
||||||
DEFINE_PROP_STRING("sysfsdev", VFIOPCIDevice, vbasedev.sysfsdev),
|
DEFINE_PROP_STRING("sysfsdev", VFIOPCIDevice, vbasedev.sysfsdev),
|
||||||
|
DEFINE_PROP_ON_OFF_AUTO("x-pre-copy-dirty-page-tracking", VFIOPCIDevice,
|
||||||
|
vbasedev.pre_copy_dirty_page_tracking,
|
||||||
|
ON_OFF_AUTO_ON),
|
||||||
DEFINE_PROP_ON_OFF_AUTO("display", VFIOPCIDevice,
|
DEFINE_PROP_ON_OFF_AUTO("display", VFIOPCIDevice,
|
||||||
display, ON_OFF_AUTO_OFF),
|
display, ON_OFF_AUTO_OFF),
|
||||||
DEFINE_PROP_UINT32("xres", VFIOPCIDevice, display_xres, 0),
|
DEFINE_PROP_UINT32("xres", VFIOPCIDevice, display_xres, 0),
|
||||||
|
@ -130,6 +130,7 @@ typedef struct VFIODevice {
|
|||||||
unsigned int flags;
|
unsigned int flags;
|
||||||
VFIOMigration *migration;
|
VFIOMigration *migration;
|
||||||
Error *migration_blocker;
|
Error *migration_blocker;
|
||||||
|
OnOffAuto pre_copy_dirty_page_tracking;
|
||||||
} VFIODevice;
|
} VFIODevice;
|
||||||
|
|
||||||
struct VFIODeviceOps {
|
struct VFIODeviceOps {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user