]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
qemuMonitorDumpToFd: Drop 'detach' argument
authorPeter Krempa <pkrempa@redhat.com>
Wed, 21 May 2025 07:50:08 +0000 (09:50 +0200)
committerPeter Krempa <pkrempa@redhat.com>
Wed, 21 May 2025 13:49:36 +0000 (15:49 +0200)
The only caller always passes 'true'. We also don't want to ever use the
blocking variant as it blocks the whole monitor until dump finishes.

Hardcode it to 'true' in the monitor code.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@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 893fa0c66cb0378616c810cf6bed03e640c8df8b..aef313ae9c9822c17289c4c803cbe78ebdd84ecc 100644 (file)
@@ -3045,7 +3045,7 @@ qemuDumpToFd(virQEMUDriver *driver,
         }
     }
 
-    rc = qemuMonitorDumpToFd(priv->mon, fd, dumpformat, true);
+    rc = qemuMonitorDumpToFd(priv->mon, fd, dumpformat);
 
     qemuDomainObjExitMonitor(vm);
     if (rc < 0)
index 981975cdd2fcf10b7137d1094194c4d0b3e844e7..d508f50ed625482f9a82fd584091320bcb121994 100644 (file)
@@ -2362,8 +2362,7 @@ qemuMonitorGetDumpGuestMemoryCapability(qemuMonitor *mon,
 int
 qemuMonitorDumpToFd(qemuMonitor *mon,
                     int fd,
-                    const char *dumpformat,
-                    bool detach)
+                    const char *dumpformat)
 {
     int ret;
     VIR_DEBUG("fd=%d dumpformat=%s", fd, dumpformat);
@@ -2373,7 +2372,7 @@ qemuMonitorDumpToFd(qemuMonitor *mon,
     if (qemuMonitorSendFileHandle(mon, "dump", fd) < 0)
         return -1;
 
-    ret = qemuMonitorJSONDump(mon, "fd:dump", dumpformat, detach);
+    ret = qemuMonitorJSONDump(mon, "fd:dump", dumpformat);
 
     if (ret < 0) {
         if (qemuMonitorCloseFileHandle(mon, "dump") < 0)
index 58d84d424bcf97cba05e17ac346bc59f5ee46e3a..51b65b40196ea93235aa5f0dd1917ed646f4b0d6 100644 (file)
@@ -893,8 +893,7 @@ int qemuMonitorQueryDump(qemuMonitor *mon,
 
 int qemuMonitorDumpToFd(qemuMonitor *mon,
                         int fd,
-                        const char *dumpformat,
-                        bool detach);
+                        const char *dumpformat);
 
 int qemuMonitorGraphicsRelocate(qemuMonitor *mon,
                                 int type,
index dc2eaace96f58213bcf25c5661307e81463ce1ac..3c2b35575eaa781edf9dcd4dc9a291a6c7a0acaf 100644 (file)
@@ -3371,8 +3371,7 @@ qemuMonitorJSONGetDumpGuestMemoryCapability(qemuMonitor *mon,
 int
 qemuMonitorJSONDump(qemuMonitor *mon,
                     const char *protocol,
-                    const char *dumpformat,
-                    bool detach)
+                    const char *dumpformat)
 {
     g_autoptr(virJSONValue) cmd = NULL;
     g_autoptr(virJSONValue) reply = NULL;
@@ -3381,7 +3380,7 @@ qemuMonitorJSONDump(qemuMonitor *mon,
                                      "b:paging", false,
                                      "s:protocol", protocol,
                                      "S:format", dumpformat,
-                                     "B:detach", detach,
+                                     "b:detach", true,
                                      NULL);
     if (!cmd)
         return -1;
index ba278af98a5a45e5ae5279c5ff1c947ac27579dc..7f07e55e06be544466df27f30d386abf9c25aac9 100644 (file)
@@ -193,8 +193,7 @@ qemuMonitorJSONGetDumpGuestMemoryCapability(qemuMonitor *mon,
 int
 qemuMonitorJSONDump(qemuMonitor *mon,
                     const char *protocol,
-                    const char *dumpformat,
-                    bool detach);
+                    const char *dumpformat);
 
 int
 qemuMonitorJSONGraphicsRelocate(qemuMonitor *mon,
index 7485f683fb94950a323d08b6ca69f249c2a99635..a18872db60f73a684050fc9429c25b4449a0658d 100644 (file)
@@ -1149,8 +1149,7 @@ GEN_TEST_FUNC(qemuMonitorJSONSaveVirtualMemory, 0, 1024, "/foo/bar")
 GEN_TEST_FUNC(qemuMonitorJSONSavePhysicalMemory, 0, 1024, "/foo/bar")
 GEN_TEST_FUNC(qemuMonitorJSONMigrate, 0, "tcp:localhost:12345")
 GEN_TEST_FUNC(qemuMonitorJSONMigrateRecover, "tcp://destination.host:54321");
-GEN_TEST_FUNC(qemuMonitorJSONDump, "dummy_protocol", "elf",
-              true)
+GEN_TEST_FUNC(qemuMonitorJSONDump, "dummy_protocol", "elf")
 GEN_TEST_FUNC(qemuMonitorJSONGraphicsRelocate, VIR_DOMAIN_GRAPHICS_TYPE_SPICE,
               "localhost", 12345, 12346, "certsubjectval")
 GEN_TEST_FUNC(qemuMonitorJSONRemoveNetdev, "net0")