qemu: monitor: Remove qemuMonitorHMPCommand in favor of qemuMonitorJSONHumanCommand

Use the function directly rather than having a wrapper.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Jiri Denemark <jdenemar@redhat.com>
This commit is contained in:
Peter Krempa 2019-09-19 17:56:18 +02:00
parent 19f8309a3b
commit a3b728f860
3 changed files with 6 additions and 19 deletions

View File

@ -1160,17 +1160,6 @@ qemuMonitorUpdateVideoVram64Size(qemuMonitorPtr mon,
}
int
qemuMonitorHMPCommand(qemuMonitorPtr mon,
const char *cmd,
char **reply)
{
QEMU_CHECK_MONITOR(mon);
return qemuMonitorJSONHumanCommand(mon, cmd, reply);
}
/* Ensure proper locking around callbacks. */
#define QEMU_MONITOR_CALLBACK(mon, ret, callback, ...) \
do { \

View File

@ -426,9 +426,6 @@ int qemuMonitorUpdateVideoVram64Size(qemuMonitorPtr mon,
virDomainVideoDefPtr video,
const char *videoName)
ATTRIBUTE_NONNULL(2) ATTRIBUTE_NONNULL(3);
int qemuMonitorHMPCommand(qemuMonitorPtr mon,
const char *cmd,
char **reply);
int qemuMonitorEmitEvent(qemuMonitorPtr mon, const char *event,
long long seconds, unsigned int micros,

View File

@ -23,6 +23,7 @@
#include "qemu_monitor_text.h"
#include "qemu_monitor_json.h"
#include "viralloc.h"
#include "virlog.h"
#include "virerror.h"
@ -44,7 +45,7 @@ int qemuMonitorTextAddDrive(qemuMonitorPtr mon,
if (virAsprintf(&cmd, "drive_add dummy %s", drivestr) < 0)
goto cleanup;
if (qemuMonitorHMPCommand(mon, cmd, &reply) < 0)
if (qemuMonitorJSONHumanCommand(mon, cmd, &reply) < 0)
goto cleanup;
if (strstr(reply, "unknown command:")) {
@ -94,7 +95,7 @@ int qemuMonitorTextDriveDel(qemuMonitorPtr mon,
if (virAsprintf(&cmd, "drive_del %s", drivestr) < 0)
goto cleanup;
if (qemuMonitorHMPCommand(mon, cmd, &reply) < 0)
if (qemuMonitorJSONHumanCommand(mon, cmd, &reply) < 0)
goto cleanup;
if (strstr(reply, "unknown command:")) {
@ -133,7 +134,7 @@ qemuMonitorTextCreateSnapshot(qemuMonitorPtr mon,
if (virAsprintf(&cmd, "savevm \"%s\"", name) < 0)
goto cleanup;
if (qemuMonitorHMPCommand(mon, cmd, &reply))
if (qemuMonitorJSONHumanCommand(mon, cmd, &reply))
goto cleanup;
if (strstr(reply, "Error while creating snapshot") ||
@ -168,7 +169,7 @@ int qemuMonitorTextLoadSnapshot(qemuMonitorPtr mon, const char *name)
if (virAsprintf(&cmd, "loadvm \"%s\"", name) < 0)
goto cleanup;
if (qemuMonitorHMPCommand(mon, cmd, &reply))
if (qemuMonitorJSONHumanCommand(mon, cmd, &reply))
goto cleanup;
if (strstr(reply, "No block device supports snapshots")) {
@ -211,7 +212,7 @@ int qemuMonitorTextDeleteSnapshot(qemuMonitorPtr mon, const char *name)
if (virAsprintf(&cmd, "delvm \"%s\"", name) < 0)
goto cleanup;
if (qemuMonitorHMPCommand(mon, cmd, &reply))
if (qemuMonitorJSONHumanCommand(mon, cmd, &reply))
goto cleanup;
if (strstr(reply, "No block device supports snapshots")) {