]> xenbits.xensource.com Git - libvirt.git/commitdiff
qemu: monitor: Remove unused arguments of qemuMonitorBlockCommit
authorPeter Krempa <pkrempa@redhat.com>
Wed, 20 Jul 2022 10:15:55 +0000 (12:15 +0200)
committerPeter Krempa <pkrempa@redhat.com>
Thu, 11 Aug 2022 13:19:11 +0000 (15:19 +0200)
The 'persistjob' is always true and 'top' and 'base' are always NULL.
Adjust the functions to drop the arguments.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Pavel Hrdina <phrdina@redhat.com>
Reviewed-by: Ján Tomko <jtomko@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 d7dde109932737b8df7a7e91d4fda7f3590dea52..28c619fe90e428aaacd8293509aa84ccd6f2fff5 100644 (file)
@@ -15580,10 +15580,7 @@ qemuDomainBlockCommit(virDomainPtr dom,
     ret = qemuMonitorBlockCommit(priv->mon,
                                  qemuDomainDiskGetTopNodename(disk),
                                  job->name,
-                                 true,
-                                 NULL,
                                  topSource->nodeformat,
-                                 NULL,
                                  baseSource->nodeformat,
                                  backingPath, speed);
 
index c24a1d3a5a6d0264247d187ed575145000739826..113c541531b9c7dd5a375be79b7cb6ffaca09e9c 100644 (file)
@@ -2863,24 +2863,19 @@ int
 qemuMonitorBlockCommit(qemuMonitor *mon,
                        const char *device,
                        const char *jobname,
-                       bool persistjob,
-                       const char *top,
                        const char *topNode,
-                       const char *base,
                        const char *baseNode,
                        const char *backingName,
                        unsigned long long bandwidth)
 {
-    VIR_DEBUG("device=%s, jobname=%s, persistjob=%d, top=%s, topNode=%s, "
-              "base=%s, baseNode=%s, backingName=%s, bandwidth=%llu",
-              device, NULLSTR(jobname), persistjob, NULLSTR(top), NULLSTR(topNode),
-              NULLSTR(base), NULLSTR(baseNode), NULLSTR(backingName), bandwidth);
+    VIR_DEBUG("device=%s, jobname=%s, topNode=%s, baseNode=%s, backingName=%s, bandwidth=%llu",
+              device, NULLSTR(jobname), NULLSTR(topNode),
+              NULLSTR(baseNode), NULLSTR(backingName), bandwidth);
 
     QEMU_CHECK_MONITOR(mon);
 
-    return qemuMonitorJSONBlockCommit(mon, device, jobname, persistjob, top,
-                                      topNode, base, baseNode, backingName,
-                                      bandwidth);
+    return qemuMonitorJSONBlockCommit(mon, device, jobname, topNode, baseNode,
+                                      backingName, bandwidth);
 }
 
 
index cc0a884470c469f51ff3f3b73ca2d2716acf4ef4..253e61cbcc7182f462bb1234a91de76a5eaba056 100644 (file)
@@ -993,10 +993,7 @@ int qemuMonitorDrivePivot(qemuMonitor *mon,
 int qemuMonitorBlockCommit(qemuMonitor *mon,
                            const char *device,
                            const char *jobname,
-                           bool persistjob,
-                           const char *top,
                            const char *topNode,
-                           const char *base,
                            const char *baseNode,
                            const char *backingName,
                            unsigned long long bandwidth)
index 71fb1d20e8a8a684d1a32099385906c6f35c2dbe..e59402b685ae04e2932da8217e653b31b51d50dd 100644 (file)
@@ -4148,31 +4148,21 @@ int
 qemuMonitorJSONBlockCommit(qemuMonitor *mon,
                            const char *device,
                            const char *jobname,
-                           bool persistjob,
-                           const char *top,
                            const char *topNode,
-                           const char *base,
                            const char *baseNode,
                            const char *backingName,
                            unsigned long long speed)
 {
     g_autoptr(virJSONValue) cmd = NULL;
     g_autoptr(virJSONValue) reply = NULL;
-    virTristateBool autofinalize = VIR_TRISTATE_BOOL_ABSENT;
-    virTristateBool autodismiss = VIR_TRISTATE_BOOL_ABSENT;
-
-    if (persistjob) {
-        autofinalize = VIR_TRISTATE_BOOL_YES;
-        autodismiss = VIR_TRISTATE_BOOL_NO;
-    }
+    virTristateBool autofinalize = VIR_TRISTATE_BOOL_YES;
+    virTristateBool autodismiss = VIR_TRISTATE_BOOL_NO;
 
     cmd = qemuMonitorJSONMakeCommand("block-commit",
                                      "s:device", device,
                                      "S:job-id", jobname,
                                      "Y:speed", speed,
-                                     "S:top", top,
                                      "S:top-node", topNode,
-                                     "S:base", base,
                                      "S:base-node", baseNode,
                                      "S:backing-file", backingName,
                                      "T:auto-finalize", autofinalize,
index e380b1b6b78236ffca1262aeb224791712fd418f..4cbd389a61d665013fdd7f44821fd81102e981d9 100644 (file)
@@ -327,10 +327,7 @@ int
 qemuMonitorJSONBlockCommit(qemuMonitor *mon,
                            const char *device,
                            const char *jobname,
-                           bool persistjob,
-                           const char *top,
                            const char *topNode,
-                           const char *base,
                            const char *baseNode,
                            const char *backingName,
                            unsigned long long bandwidth)
index 816fb2cd71e2c03ed4dc4941d56a517b2ba8eb2a..db7478fb2eefbc67af02cc1afe62e3cd59711aeb 100644 (file)
@@ -1215,7 +1215,7 @@ GEN_TEST_FUNC(qemuMonitorJSONRemoveNetdev, "net0")
 GEN_TEST_FUNC(qemuMonitorJSONDelDevice, "ide0")
 GEN_TEST_FUNC(qemuMonitorJSONBlockdevMirror, "jobname", true, "vdb", "targetnode", 1024, 1234, 31234, true, true)
 GEN_TEST_FUNC(qemuMonitorJSONBlockStream, "vdb", "jobname", true, "/foo/bar1", "backingnode", "backingfilename", 1024)
-GEN_TEST_FUNC(qemuMonitorJSONBlockCommit, "vdb", "jobname", true, "/foo/bar1", "topnode", "/foo/bar2", "basenode", "backingfilename", 1024)
+GEN_TEST_FUNC(qemuMonitorJSONBlockCommit, "vdb", "jobname", "topnode", "basenode", "backingfilename", 1024)
 GEN_TEST_FUNC(qemuMonitorJSONDrivePivot, "vdb")
 GEN_TEST_FUNC(qemuMonitorJSONScreendump, "devicename", 1, "/foo/bar")
 GEN_TEST_FUNC(qemuMonitorJSONOpenGraphics, "spice", "spicefd", false)