Add a new optional "@detach" parameter to the dump-guest-memory command.
If the value is false, then don't add the parameter to the command line
(even though QMP could handle that).
Signed-off-by: John Ferlan <jferlan(a)redhat.com>
---
src/qemu/qemu_driver.c | 2 +-
src/qemu/qemu_monitor.c | 7 +++++--
src/qemu/qemu_monitor.h | 3 ++-
src/qemu/qemu_monitor_json.c | 4 +++-
src/qemu/qemu_monitor_json.h | 3 ++-
tests/qemumonitorjsontest.c | 3 ++-
6 files changed, 15 insertions(+), 7 deletions(-)
diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c
index 2dac8432ac..066c778726 100644
--- a/src/qemu/qemu_driver.c
+++ b/src/qemu/qemu_driver.c
@@ -3788,7 +3788,7 @@ qemuDumpToFd(virQEMUDriverPtr driver,
}
}
- ret = qemuMonitorDumpToFd(priv->mon, fd, dumpformat);
+ ret = qemuMonitorDumpToFd(priv->mon, fd, dumpformat, false);
cleanup:
ignore_value(qemuDomainObjExitMonitor(driver, vm));
diff --git a/src/qemu/qemu_monitor.c b/src/qemu/qemu_monitor.c
index 1578cd4e5f..f4cebfb949 100644
--- a/src/qemu/qemu_monitor.c
+++ b/src/qemu/qemu_monitor.c
@@ -2780,7 +2780,10 @@ qemuMonitorGetDumpGuestMemoryCapability(qemuMonitorPtr mon,
int
-qemuMonitorDumpToFd(qemuMonitorPtr mon, int fd, const char *dumpformat)
+qemuMonitorDumpToFd(qemuMonitorPtr mon,
+ int fd,
+ const char *dumpformat,
+ bool detach)
{
int ret;
VIR_DEBUG("fd=%d dumpformat=%s", fd, dumpformat);
@@ -2790,7 +2793,7 @@ qemuMonitorDumpToFd(qemuMonitorPtr mon, int fd, const char
*dumpformat)
if (qemuMonitorSendFileHandle(mon, "dump", fd) < 0)
return -1;
- ret = qemuMonitorJSONDump(mon, "fd:dump", dumpformat);
+ ret = qemuMonitorJSONDump(mon, "fd:dump", dumpformat, detach);
if (ret < 0) {
if (qemuMonitorCloseFileHandle(mon, "dump") < 0)
diff --git a/src/qemu/qemu_monitor.h b/src/qemu/qemu_monitor.h
index da58d77e4e..a15f315389 100644
--- a/src/qemu/qemu_monitor.h
+++ b/src/qemu/qemu_monitor.h
@@ -780,7 +780,8 @@ int qemuMonitorQueryDump(qemuMonitorPtr mon,
int qemuMonitorDumpToFd(qemuMonitorPtr mon,
int fd,
- const char *dumpformat);
+ const char *dumpformat,
+ bool detach);
int qemuMonitorGraphicsRelocate(qemuMonitorPtr mon,
int type,
diff --git a/src/qemu/qemu_monitor_json.c b/src/qemu/qemu_monitor_json.c
index be2961b6ee..799b1991cb 100644
--- a/src/qemu/qemu_monitor_json.c
+++ b/src/qemu/qemu_monitor_json.c
@@ -3228,7 +3228,8 @@ qemuMonitorJSONGetDumpGuestMemoryCapability(qemuMonitorPtr mon,
int
qemuMonitorJSONDump(qemuMonitorPtr mon,
const char *protocol,
- const char *dumpformat)
+ const char *dumpformat,
+ bool detach)
{
int ret = -1;
virJSONValuePtr cmd = NULL;
@@ -3238,6 +3239,7 @@ qemuMonitorJSONDump(qemuMonitorPtr mon,
"b:paging", false,
"s:protocol", protocol,
"S:dumpformat", dumpformat,
+ "B:detach", detach,
NULL);
if (!cmd)
return -1;
diff --git a/src/qemu/qemu_monitor_json.h b/src/qemu/qemu_monitor_json.h
index 090e3a1441..5baddbc8ab 100644
--- a/src/qemu/qemu_monitor_json.h
+++ b/src/qemu/qemu_monitor_json.h
@@ -171,7 +171,8 @@ int qemuMonitorJSONGetDumpGuestMemoryCapability(qemuMonitorPtr mon,
int qemuMonitorJSONDump(qemuMonitorPtr mon,
const char *protocol,
- const char *dumpformat);
+ const char *dumpformat,
+ bool detach);
int qemuMonitorJSONGraphicsRelocate(qemuMonitorPtr mon,
int type,
diff --git a/tests/qemumonitorjsontest.c b/tests/qemumonitorjsontest.c
index fe46a33eb0..1eeefbce9b 100644
--- a/tests/qemumonitorjsontest.c
+++ b/tests/qemumonitorjsontest.c
@@ -1330,7 +1330,8 @@ 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(qemuMonitorJSONDump, "dummy_protocol",
"dummy_memory_dump_format")
+GEN_TEST_FUNC(qemuMonitorJSONDump, "dummy_protocol",
"dummy_memory_dump_format",
+ true)
GEN_TEST_FUNC(qemuMonitorJSONGraphicsRelocate, VIR_DOMAIN_GRAPHICS_TYPE_SPICE,
"localhost", 12345, 12346, NULL)
GEN_TEST_FUNC(qemuMonitorJSONAddNetdev, "some_dummy_netdevstr")
--
2.13.6