]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
qemu: Add new parameter to qemuMonitorDumpToFd
authorJohn Ferlan <jferlan@redhat.com>
Mon, 20 Nov 2017 20:05:23 +0000 (15:05 -0500)
committerJohn Ferlan <jferlan@redhat.com>
Tue, 6 Feb 2018 12:39:20 +0000 (07:39 -0500)
Add a @detach parameter to the API in order allow running the QEMU
code as a thread.

Reviewed-by: Jiri Denemark <jdenemar redhat com>
src/qemu/qemu_driver.c
src/qemu/qemu_monitor.c
src/qemu/qemu_monitor.h
src/qemu/qemu_monitor_json.c
src/qemu/qemu_monitor_json.h
tests/qemumonitorjsontest.c

index 05e772df4a579676e650873394ec9adf4240cb40..68e7138d562795cb28e17ccd28ca7756e3977889 100644 (file)
@@ -3798,7 +3798,7 @@ qemuDumpToFd(virQEMUDriverPtr driver,
         }
     }
 
-    ret = qemuMonitorDumpToFd(priv->mon, fd, dumpformat);
+    ret = qemuMonitorDumpToFd(priv->mon, fd, dumpformat, false);
 
  cleanup:
     ignore_value(qemuDomainObjExitMonitor(driver, vm));
index fd19699afef4fb948f69aad04129c10de6bee6a3..9b5ad72cf9ca4644d68d125c2ed1993043f15d02 100644 (file)
@@ -2805,7 +2805,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);
@@ -2815,7 +2818,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)
index 83187599ac64974331567b64ef15bab88aca10a0..ea0c01ae7f530b0c6233046162727b9e3804ef2a 100644 (file)
@@ -795,7 +795,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,
index 0acce144cd63022942f0381ffb4b2230fcaf53dc..242b92ea3fa162aea0dd699f34421f0d7f78af0f 100644 (file)
@@ -3263,7 +3263,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;
@@ -3273,6 +3274,7 @@ qemuMonitorJSONDump(qemuMonitorPtr mon,
                                      "b:paging", false,
                                      "s:protocol", protocol,
                                      "S:format", dumpformat,
+                                     "B:detach", detach,
                                      NULL);
     if (!cmd)
         return -1;
index 2f59518ba8b6001e00f8bbcd4c7387445325543f..a62e2418dc23cd1a3bc486c3e55369dc29683470 100644 (file)
@@ -170,7 +170,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,
index fe46a33eb0d43f6ba6d92418f971c25e82b4105d..1eeefbce9b03d316b01e093a3b7aad8e296e085c 100644 (file)
@@ -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")