[libvirt] [PATCH 3/8] qemu: monitor: Remove temporary variables

Peter Krempa pkrempa at redhat.com
Wed Aug 15 11:52:54 UTC 2018


Now that the job name is used in single place in the respective
functions remove the temporary strings.

Signed-off-by: Peter Krempa <pkrempa at redhat.com>
---
 src/qemu/qemu_monitor_json.c | 9 +++------
 1 file changed, 3 insertions(+), 6 deletions(-)

diff --git a/src/qemu/qemu_monitor_json.c b/src/qemu/qemu_monitor_json.c
index a361a0acd9..931d3dd985 100644
--- a/src/qemu/qemu_monitor_json.c
+++ b/src/qemu/qemu_monitor_json.c
@@ -4686,9 +4686,8 @@ qemuMonitorJSONBlockStream(qemuMonitorPtr mon,
     int ret = -1;
     virJSONValuePtr cmd = NULL;
     virJSONValuePtr reply = NULL;
-    const char *cmd_name = "block-stream";

-    if (!(cmd = qemuMonitorJSONMakeCommand(cmd_name,
+    if (!(cmd = qemuMonitorJSONMakeCommand("block-stream",
                                            "s:device", device,
                                            "Y:speed", speed,
                                            "S:base", base,
@@ -4718,9 +4717,8 @@ qemuMonitorJSONBlockJobCancel(qemuMonitorPtr mon,
     int ret = -1;
     virJSONValuePtr cmd = NULL;
     virJSONValuePtr reply = NULL;
-    const char *cmd_name = "block-job-cancel";

-    if (!(cmd = qemuMonitorJSONMakeCommand(cmd_name,
+    if (!(cmd = qemuMonitorJSONMakeCommand("block-job-cancel",
                                            "s:device", device,
                                            NULL)))
         return -1;
@@ -4748,9 +4746,8 @@ qemuMonitorJSONBlockJobSetSpeed(qemuMonitorPtr mon,
     int ret = -1;
     virJSONValuePtr cmd;
     virJSONValuePtr reply = NULL;
-    const char *cmd_name = "block-job-set-speed";

-    if (!(cmd = qemuMonitorJSONMakeCommand(cmd_name,
+    if (!(cmd = qemuMonitorJSONMakeCommand("block-job-set-speed",
                                            "s:device", device,
                                            "J:speed", speed,
                                            NULL)))
-- 
2.16.2




More information about the libvir-list mailing list