[libvirt PATCH v2 55/81] qemu: Add support for 'resume' parameter of migrate QMP command

Jiri Denemark jdenemar at redhat.com
Wed Jun 1 12:49:55 UTC 2022


Signed-off-by: Jiri Denemark <jdenemar at redhat.com>
Reviewed-by: Peter Krempa <pkrempa at redhat.com>
Reviewed-by: Pavel Hrdina <phrdina at redhat.com>
---

Notes:
    Version 2:
    - no change

 src/qemu/qemu_migration.c    | 8 ++++++--
 src/qemu/qemu_monitor.h      | 1 +
 src/qemu/qemu_monitor_json.c | 2 ++
 3 files changed, 9 insertions(+), 2 deletions(-)

diff --git a/src/qemu/qemu_migration.c b/src/qemu/qemu_migration.c
index 51feb785f5..9996227057 100644
--- a/src/qemu/qemu_migration.c
+++ b/src/qemu/qemu_migration.c
@@ -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:
diff --git a/src/qemu/qemu_monitor.h b/src/qemu/qemu_monitor.h
index 41e8db945c..98496b9037 100644
--- a/src/qemu/qemu_monitor.h
+++ b/src/qemu/qemu_monitor.h
@@ -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;
 
diff --git a/src/qemu/qemu_monitor_json.c b/src/qemu/qemu_monitor_json.c
index 86b7f615c8..8b026e8ade 100644
--- a/src/qemu/qemu_monitor_json.c
+++ b/src/qemu/qemu_monitor_json.c
@@ -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;
-- 
2.35.1



More information about the libvir-list mailing list