mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-03-07 17:28:15 +00:00
qemuMonitorJSONHumanCommand: Require @reply_str
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@redhat.com> Reviewed-by: Tim Wiederhake <twiederh@redhat.com>
This commit is contained in:
parent
2d7257d528
commit
a70ae22cfd
@ -1470,6 +1470,7 @@ qemuMonitorJSONHumanCommand(qemuMonitor *mon,
|
|||||||
virJSONValue *cmd = NULL;
|
virJSONValue *cmd = NULL;
|
||||||
virJSONValue *reply = NULL;
|
virJSONValue *reply = NULL;
|
||||||
virJSONValue *obj;
|
virJSONValue *obj;
|
||||||
|
const char *data;
|
||||||
int ret = -1;
|
int ret = -1;
|
||||||
|
|
||||||
cmd = qemuMonitorJSONMakeCommand("human-monitor-command",
|
cmd = qemuMonitorJSONMakeCommand("human-monitor-command",
|
||||||
@ -1490,13 +1491,8 @@ qemuMonitorJSONHumanCommand(qemuMonitor *mon,
|
|||||||
goto cleanup;
|
goto cleanup;
|
||||||
|
|
||||||
obj = virJSONValueObjectGet(reply, "return");
|
obj = virJSONValueObjectGet(reply, "return");
|
||||||
|
|
||||||
if (reply_str) {
|
|
||||||
const char *data;
|
|
||||||
|
|
||||||
data = virJSONValueGetString(obj);
|
data = virJSONValueGetString(obj);
|
||||||
*reply_str = g_strdup(NULLSTR_EMPTY(data));
|
*reply_str = g_strdup(NULLSTR_EMPTY(data));
|
||||||
}
|
|
||||||
|
|
||||||
ret = 0;
|
ret = 0;
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user