This command tells QEMU to start listening for an incoming post-copy
recovery connection. Just like migrate-incoming is used for starting
fresh migration on the destination host.
Signed-off-by: Jiri Denemark <jdenemar(a)redhat.com>
Reviewed-by: Peter Krempa <pkrempa(a)redhat.com>
Reviewed-by: Pavel Hrdina <phrdina(a)redhat.com>
---
Notes:
Version 2:
- added a case in qemumonitorjsontest
src/qemu/qemu_monitor.c | 12 ++++++++++++
src/qemu/qemu_monitor.h | 4 ++++
src/qemu/qemu_monitor_json.c | 19 +++++++++++++++++++
src/qemu/qemu_monitor_json.h | 4 ++++
tests/qemumonitorjsontest.c | 2 ++
5 files changed, 41 insertions(+)
diff --git a/src/qemu/qemu_monitor.c b/src/qemu/qemu_monitor.c
index ec56d413da..e9b9390c80 100644
--- a/src/qemu/qemu_monitor.c
+++ b/src/qemu/qemu_monitor.c
@@ -4521,3 +4521,15 @@ qemuMonitorChangeMemoryRequestedSize(qemuMonitor *mon,
return qemuMonitorJSONChangeMemoryRequestedSize(mon, alias, requestedsize);
}
+
+
+int
+qemuMonitorMigrateRecover(qemuMonitor *mon,
+ const char *uri)
+{
+ VIR_DEBUG("uri=%s", uri);
+
+ QEMU_CHECK_MONITOR(mon);
+
+ return qemuMonitorJSONMigrateRecover(mon, uri);
+}
diff --git a/src/qemu/qemu_monitor.h b/src/qemu/qemu_monitor.h
index 98496b9037..4f6c7e40fd 100644
--- a/src/qemu/qemu_monitor.h
+++ b/src/qemu/qemu_monitor.h
@@ -1545,3 +1545,7 @@ int
qemuMonitorChangeMemoryRequestedSize(qemuMonitor *mon,
const char *alias,
unsigned long long requestedsize);
+
+int
+qemuMonitorMigrateRecover(qemuMonitor *mon,
+ const char *uri);
diff --git a/src/qemu/qemu_monitor_json.c b/src/qemu/qemu_monitor_json.c
index 8b026e8ade..99c5e1b40f 100644
--- a/src/qemu/qemu_monitor_json.c
+++ b/src/qemu/qemu_monitor_json.c
@@ -8970,3 +8970,22 @@ qemuMonitorJSONChangeMemoryRequestedSize(qemuMonitor *mon,
return qemuMonitorJSONSetObjectProperty(mon, path, "requested-size",
&prop);
}
+
+
+int
+qemuMonitorJSONMigrateRecover(qemuMonitor *mon,
+ const char *uri)
+{
+ g_autoptr(virJSONValue) cmd = NULL;
+ g_autoptr(virJSONValue) reply = NULL;
+
+ if (!(cmd = qemuMonitorJSONMakeCommand("migrate-recover",
+ "s:uri", uri,
+ NULL)))
+ return -1;
+
+ if (qemuMonitorJSONCommand(mon, cmd, &reply) < 0)
+ return -1;
+
+ return qemuMonitorJSONCheckError(cmd, reply);
+}
diff --git a/src/qemu/qemu_monitor_json.h b/src/qemu/qemu_monitor_json.h
index 3c442d669f..305faafce4 100644
--- a/src/qemu/qemu_monitor_json.h
+++ b/src/qemu/qemu_monitor_json.h
@@ -872,3 +872,7 @@ int
qemuMonitorJSONChangeMemoryRequestedSize(qemuMonitor *mon,
const char *alias,
unsigned long long requestedsize);
+
+int
+qemuMonitorJSONMigrateRecover(qemuMonitor *mon,
+ const char *uri);
diff --git a/tests/qemumonitorjsontest.c b/tests/qemumonitorjsontest.c
index 2de282dcba..96d6da1f47 100644
--- a/tests/qemumonitorjsontest.c
+++ b/tests/qemumonitorjsontest.c
@@ -1210,6 +1210,7 @@ GEN_TEST_FUNC(qemuMonitorJSONSetMigrationDowntime, 1)
GEN_TEST_FUNC(qemuMonitorJSONMigrate, QEMU_MONITOR_MIGRATE_BACKGROUND |
QEMU_MONITOR_MIGRATE_NON_SHARED_DISK |
QEMU_MONITOR_MIGRATE_NON_SHARED_INC, "tcp:localhost:12345")
+GEN_TEST_FUNC(qemuMonitorJSONMigrateRecover, "tcp://destination.host:54321");
GEN_TEST_FUNC(qemuMonitorJSONDump, "dummy_protocol", "elf",
true)
GEN_TEST_FUNC(qemuMonitorJSONGraphicsRelocate, VIR_DOMAIN_GRAPHICS_TYPE_SPICE,
@@ -3109,6 +3110,7 @@ mymain(void)
DO_TEST_GEN_DEPRECATED(qemuMonitorJSONSetMigrationSpeed, true);
DO_TEST_GEN_DEPRECATED(qemuMonitorJSONSetMigrationDowntime, true);
DO_TEST_GEN(qemuMonitorJSONMigrate);
+ DO_TEST_GEN(qemuMonitorJSONMigrateRecover);
DO_TEST_GEN(qemuMonitorJSONDump);
DO_TEST_GEN(qemuMonitorJSONGraphicsRelocate);
DO_TEST_GEN(qemuMonitorJSONRemoveNetdev);
--
2.35.1