qemu: Add support for 'resume' parameter of migrate QMP command

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Pavel Hrdina <phrdina@redhat.com>
This commit is contained in:
Jiri Denemark 2022-05-10 15:20:25 +02:00
parent 691ce4ea8f
commit 07a2a6e511
3 changed files with 9 additions and 2 deletions

View File

@ -4399,8 +4399,12 @@ qemuMigrationSrcStart(virDomainObj *vm,
}
/* log start of migration */
if ((timestamp = virTimeStringNow()) != NULL)
qemuDomainLogAppendMessage(driver, vm, "%s: initiating migration\n", timestamp);
if ((timestamp = virTimeStringNow()) != NULL) {
if (migrateFlags & QEMU_MONITOR_MIGRATE_RESUME)
qemuDomainLogAppendMessage(driver, vm, "%s: resuming migration\n", timestamp);
else
qemuDomainLogAppendMessage(driver, vm, "%s: initiating migration\n", timestamp);
}
switch (spec->destType) {
case MIGRATION_DEST_HOST:

View File

@ -870,6 +870,7 @@ typedef enum {
QEMU_MONITOR_MIGRATE_BACKGROUND = 1 << 0,
QEMU_MONITOR_MIGRATE_NON_SHARED_DISK = 1 << 1, /* migration with non-shared storage with full disk copy */
QEMU_MONITOR_MIGRATE_NON_SHARED_INC = 1 << 2, /* migration with non-shared storage with incremental copy */
QEMU_MONITOR_MIGRATE_RESUME = 1 << 3, /* resume failed post-copy migration */
QEMU_MONITOR_MIGRATION_FLAGS_LAST
} QEMU_MONITOR_MIGRATE;

View File

@ -3416,10 +3416,12 @@ int qemuMonitorJSONMigrate(qemuMonitor *mon,
bool detach = !!(flags & QEMU_MONITOR_MIGRATE_BACKGROUND);
bool blk = !!(flags & QEMU_MONITOR_MIGRATE_NON_SHARED_DISK);
bool inc = !!(flags & QEMU_MONITOR_MIGRATE_NON_SHARED_INC);
bool resume = !!(flags & QEMU_MONITOR_MIGRATE_RESUME);
g_autoptr(virJSONValue) cmd = qemuMonitorJSONMakeCommand("migrate",
"b:detach", detach,
"b:blk", blk,
"b:inc", inc,
"b:resume", resume,
"s:uri", uri,
NULL);
g_autoptr(virJSONValue) reply = NULL;