[PATCH 03/13] qemuMonitorJSONHumanCommand: Require @reply_str

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



All callers of qemuMonitorJSONHumanCommand() pass a non-NULL pointer
as @reply_str therefore there's no need to check whether it is NULL.
NB, the sister function (qemuMonitorJSONArbitraryCommand()) doesn't
check for NULL either.

Signed-off-by: Michal Privoznik <mprivozn@xxxxxxxxxx>
---
 src/qemu/qemu_monitor_json.c | 10 +++-------
 1 file changed, 3 insertions(+), 7 deletions(-)

diff --git a/src/qemu/qemu_monitor_json.c b/src/qemu/qemu_monitor_json.c
index 6d8ccd91e8..7833038a06 100644
--- a/src/qemu/qemu_monitor_json.c
+++ b/src/qemu/qemu_monitor_json.c
@@ -1470,6 +1470,7 @@ qemuMonitorJSONHumanCommand(qemuMonitor *mon,
     virJSONValue *cmd = NULL;
     virJSONValue *reply = NULL;
     virJSONValue *obj;
+    const char *data;
     int ret = -1;
 
     cmd = qemuMonitorJSONMakeCommand("human-monitor-command",
@@ -1490,13 +1491,8 @@ qemuMonitorJSONHumanCommand(qemuMonitor *mon,
         goto cleanup;
 
     obj = virJSONValueObjectGet(reply, "return");
-
-    if (reply_str) {
-        const char *data;
-
-        data = virJSONValueGetString(obj);
-        *reply_str = g_strdup(NULLSTR_EMPTY(data));
-    }
+    data = virJSONValueGetString(obj);
+    *reply_str = g_strdup(NULLSTR_EMPTY(data));
 
     ret = 0;
 
-- 
2.32.0




[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]

  Powered by Linux