提交 19f8309a 编写于 作者: P Peter Krempa

qemu: monitor: Don't handle HMP in qemuMonitorJSONArbitraryCommand

Call to qemuMonitorJSONHumanCommand directly from
qemuMonitorArbitraryCommand.
Signed-off-by: NPeter Krempa <pkrempa@redhat.com>
Reviewed-by: NJiri Denemark <jdenemar@redhat.com>
上级 1155a572
...@@ -3191,7 +3191,10 @@ qemuMonitorArbitraryCommand(qemuMonitorPtr mon, ...@@ -3191,7 +3191,10 @@ qemuMonitorArbitraryCommand(qemuMonitorPtr mon,
QEMU_CHECK_MONITOR(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, ...@@ -4624,25 +4624,20 @@ qemuMonitorJSONDiskNameLookup(qemuMonitorPtr mon,
int qemuMonitorJSONArbitraryCommand(qemuMonitorPtr mon, int qemuMonitorJSONArbitraryCommand(qemuMonitorPtr mon,
const char *cmd_str, const char *cmd_str,
char **reply_str, char **reply_str)
bool hmp)
{ {
virJSONValuePtr cmd = NULL; virJSONValuePtr cmd = NULL;
virJSONValuePtr reply = NULL; virJSONValuePtr reply = NULL;
int ret = -1; int ret = -1;
if (hmp) { if (!(cmd = virJSONValueFromString(cmd_str)))
return qemuMonitorJSONHumanCommand(mon, cmd_str, reply_str); goto cleanup;
} else {
if (!(cmd = virJSONValueFromString(cmd_str)))
goto cleanup;
if (qemuMonitorJSONCommand(mon, cmd, &reply) < 0) if (qemuMonitorJSONCommand(mon, cmd, &reply) < 0)
goto cleanup; goto cleanup;
if (!(*reply_str = virJSONValueToString(reply, false))) if (!(*reply_str = virJSONValueToString(reply, false)))
goto cleanup; goto cleanup;
}
ret = 0; ret = 0;
......
...@@ -286,8 +286,7 @@ char *qemuMonitorJSONDiskNameLookup(qemuMonitorPtr mon, ...@@ -286,8 +286,7 @@ char *qemuMonitorJSONDiskNameLookup(qemuMonitorPtr mon,
int qemuMonitorJSONArbitraryCommand(qemuMonitorPtr mon, int qemuMonitorJSONArbitraryCommand(qemuMonitorPtr mon,
const char *cmd_str, const char *cmd_str,
char **reply_str, char **reply_str);
bool hmp);
int qemuMonitorJSONInjectNMI(qemuMonitorPtr mon); int qemuMonitorJSONInjectNMI(qemuMonitorPtr mon);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册