mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-03-21 10:50:24 +03:00
qemu: monitor: Don't handle HMP in qemuMonitorJSONArbitraryCommand
Call to qemuMonitorJSONHumanCommand directly from qemuMonitorArbitraryCommand. Signed-off-by: Peter Krempa <pkrempa@redhat.com> Reviewed-by: Jiri Denemark <jdenemar@redhat.com>
This commit is contained in:
parent
1155a5721b
commit
19f8309a3b
@ -3191,7 +3191,10 @@ qemuMonitorArbitraryCommand(qemuMonitorPtr mon,
|
||||
|
||||
QEMU_CHECK_MONITOR(mon);
|
||||
|
||||
return qemuMonitorJSONArbitraryCommand(mon, cmd, reply, hmp);
|
||||
if (hmp)
|
||||
return qemuMonitorJSONHumanCommand(mon, cmd, reply);
|
||||
else
|
||||
return qemuMonitorJSONArbitraryCommand(mon, cmd, reply);
|
||||
}
|
||||
|
||||
|
||||
|
@ -4624,25 +4624,20 @@ qemuMonitorJSONDiskNameLookup(qemuMonitorPtr mon,
|
||||
|
||||
int qemuMonitorJSONArbitraryCommand(qemuMonitorPtr mon,
|
||||
const char *cmd_str,
|
||||
char **reply_str,
|
||||
bool hmp)
|
||||
char **reply_str)
|
||||
{
|
||||
virJSONValuePtr cmd = NULL;
|
||||
virJSONValuePtr reply = NULL;
|
||||
int ret = -1;
|
||||
|
||||
if (hmp) {
|
||||
return qemuMonitorJSONHumanCommand(mon, cmd_str, reply_str);
|
||||
} else {
|
||||
if (!(cmd = virJSONValueFromString(cmd_str)))
|
||||
goto cleanup;
|
||||
if (!(cmd = virJSONValueFromString(cmd_str)))
|
||||
goto cleanup;
|
||||
|
||||
if (qemuMonitorJSONCommand(mon, cmd, &reply) < 0)
|
||||
goto cleanup;
|
||||
if (qemuMonitorJSONCommand(mon, cmd, &reply) < 0)
|
||||
goto cleanup;
|
||||
|
||||
if (!(*reply_str = virJSONValueToString(reply, false)))
|
||||
goto cleanup;
|
||||
}
|
||||
if (!(*reply_str = virJSONValueToString(reply, false)))
|
||||
goto cleanup;
|
||||
|
||||
ret = 0;
|
||||
|
||||
|
@ -286,8 +286,7 @@ char *qemuMonitorJSONDiskNameLookup(qemuMonitorPtr mon,
|
||||
|
||||
int qemuMonitorJSONArbitraryCommand(qemuMonitorPtr mon,
|
||||
const char *cmd_str,
|
||||
char **reply_str,
|
||||
bool hmp);
|
||||
char **reply_str);
|
||||
|
||||
int qemuMonitorJSONInjectNMI(qemuMonitorPtr mon);
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user