mirror of
https://github.com/izzy2lost/xemu.git
synced 2026-07-06 00:20:22 -07:00
Merge remote-tracking branch 'remotes/awilliam/tags/vfio-update-20201123.0' into staging
VFIO update 2020-11-23 * Enable pre-copy dirty page tracking by default (Kirti Wankhede) * Mark migration as experimental (Alex Williamson) # gpg: Signature made Mon 23 Nov 2020 17:10:58 GMT # gpg: using RSA key 239B9B6E3BB08B22 # gpg: Good signature from "Alex Williamson <alex.williamson@redhat.com>" [full] # gpg: aka "Alex Williamson <alex@shazbot.org>" [full] # gpg: aka "Alex Williamson <alwillia@redhat.com>" [full] # gpg: aka "Alex Williamson <alex.l.williamson@gmail.com>" [full] # Primary key fingerprint: 42F6 C04E 540B D1A9 9E7B 8A90 239B 9B6E 3BB0 8B22 * remotes/awilliam/tags/vfio-update-20201123.0: vfio: Change default dirty pages tracking behavior during migration vfio: Make migration support experimental Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
This commit is contained in:
+7
-4
@@ -311,7 +311,7 @@ bool vfio_mig_active(void)
|
||||
return true;
|
||||
}
|
||||
|
||||
static bool vfio_devices_all_stopped_and_saving(VFIOContainer *container)
|
||||
static bool vfio_devices_all_saving(VFIOContainer *container)
|
||||
{
|
||||
VFIOGroup *group;
|
||||
VFIODevice *vbasedev;
|
||||
@@ -329,8 +329,11 @@ static bool vfio_devices_all_stopped_and_saving(VFIOContainer *container)
|
||||
return false;
|
||||
}
|
||||
|
||||
if ((migration->device_state & VFIO_DEVICE_STATE_SAVING) &&
|
||||
!(migration->device_state & VFIO_DEVICE_STATE_RUNNING)) {
|
||||
if (migration->device_state & VFIO_DEVICE_STATE_SAVING) {
|
||||
if ((vbasedev->pre_copy_dirty_page_tracking == ON_OFF_AUTO_OFF)
|
||||
&& (migration->device_state & VFIO_DEVICE_STATE_RUNNING)) {
|
||||
return false;
|
||||
}
|
||||
continue;
|
||||
} else {
|
||||
return false;
|
||||
@@ -1125,7 +1128,7 @@ static void vfio_listerner_log_sync(MemoryListener *listener,
|
||||
return;
|
||||
}
|
||||
|
||||
if (vfio_devices_all_stopped_and_saving(container)) {
|
||||
if (vfio_devices_all_saving(container)) {
|
||||
vfio_sync_dirty_bitmap(container, section);
|
||||
}
|
||||
}
|
||||
|
||||
+1
-1
@@ -882,7 +882,7 @@ int vfio_migration_probe(VFIODevice *vbasedev, Error **errp)
|
||||
Error *local_err = NULL;
|
||||
int ret = -ENOTSUP;
|
||||
|
||||
if (!container->dirty_pages_supported) {
|
||||
if (!vbasedev->enable_migration || !container->dirty_pages_supported) {
|
||||
goto add_blocker;
|
||||
}
|
||||
|
||||
|
||||
@@ -3182,6 +3182,9 @@ static void vfio_instance_init(Object *obj)
|
||||
static Property vfio_pci_dev_properties[] = {
|
||||
DEFINE_PROP_PCI_HOST_DEVADDR("host", VFIOPCIDevice, host),
|
||||
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,
|
||||
display, ON_OFF_AUTO_OFF),
|
||||
DEFINE_PROP_UINT32("xres", VFIOPCIDevice, display_xres, 0),
|
||||
@@ -3194,6 +3197,8 @@ static Property vfio_pci_dev_properties[] = {
|
||||
VFIO_FEATURE_ENABLE_REQ_BIT, true),
|
||||
DEFINE_PROP_BIT("x-igd-opregion", VFIOPCIDevice, features,
|
||||
VFIO_FEATURE_ENABLE_IGD_OPREGION_BIT, false),
|
||||
DEFINE_PROP_BOOL("x-enable-migration", VFIOPCIDevice,
|
||||
vbasedev.enable_migration, false),
|
||||
DEFINE_PROP_BOOL("x-no-mmap", VFIOPCIDevice, vbasedev.no_mmap, false),
|
||||
DEFINE_PROP_BOOL("x-balloon-allowed", VFIOPCIDevice,
|
||||
vbasedev.ram_block_discard_allowed, false),
|
||||
|
||||
@@ -123,12 +123,14 @@ typedef struct VFIODevice {
|
||||
bool needs_reset;
|
||||
bool no_mmap;
|
||||
bool ram_block_discard_allowed;
|
||||
bool enable_migration;
|
||||
VFIODeviceOps *ops;
|
||||
unsigned int num_irqs;
|
||||
unsigned int num_regions;
|
||||
unsigned int flags;
|
||||
VFIOMigration *migration;
|
||||
Error *migration_blocker;
|
||||
OnOffAuto pre_copy_dirty_page_tracking;
|
||||
} VFIODevice;
|
||||
|
||||
struct VFIODeviceOps {
|
||||
|
||||
Reference in New Issue
Block a user