}
static int
-qemuMonitorJSONCheckError(virJSONValuePtr cmd,
- virJSONValuePtr reply)
+qemuMonitorJSONCheckErrorFull(virJSONValuePtr cmd,
+ virJSONValuePtr reply,
+ bool report)
{
if (virJSONValueObjectHasKey(reply, "error")) {
virJSONValuePtr error = virJSONValueObjectGet(reply, "error");
VIR_DEBUG("unable to execute QEMU command %s: %s",
NULLSTR(cmdstr), NULLSTR(replystr));
+ if (!report)
+ return -1;
+
/* Only send the user the command name + friendly error */
if (!error)
virReportError(VIR_ERR_INTERNAL_ERROR,
VIR_DEBUG("Neither 'return' nor 'error' is set in the JSON reply %s: %s",
NULLSTR(cmdstr), NULLSTR(replystr));
+
+ if (!report)
+ return -1;
+
virReportError(VIR_ERR_INTERNAL_ERROR,
_("unable to execute QEMU command '%s'"),
qemuMonitorJSONCommandName(cmd));
}
+static int
+qemuMonitorJSONCheckError(virJSONValuePtr cmd,
+ virJSONValuePtr reply)
+{
+ return qemuMonitorJSONCheckErrorFull(cmd, reply, true);
+}
+
+
static int
qemuMonitorJSONCheckReply(virJSONValuePtr cmd,
virJSONValuePtr reply,