diff --git a/src/qemu/qemu_monitor.c b/src/qemu/qemu_monitor.c index f52a38198291c8893bcabc1f2f939eaa433c26ed..af4c41fa166f22dbf88353623f5506f165d1b318 100644 --- a/src/qemu/qemu_monitor.c +++ b/src/qemu/qemu_monitor.c @@ -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); } diff --git a/src/qemu/qemu_monitor_json.c b/src/qemu/qemu_monitor_json.c index 891d2c30897788dbf1c65ae94fa2cd871d4fb4d8..b8ec9ac59a36f6daacce36d558892e8605cd4f59 100644 --- a/src/qemu/qemu_monitor_json.c +++ b/src/qemu/qemu_monitor_json.c @@ -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; diff --git a/src/qemu/qemu_monitor_json.h b/src/qemu/qemu_monitor_json.h index 533069788504923edcd5554b3d13e6fa25d59c69..a60841070305e8cf44f15ad92a46c4c75e7ca8c7 100644 --- a/src/qemu/qemu_monitor_json.h +++ b/src/qemu/qemu_monitor_json.h @@ -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);