if ((ret = qemuMonitorJSONCommand(mon, cmd, &reply)) < 0)
goto cleanup;
- if (qemuMonitorJSONHasError(reply, "CommandNotFound")) {
+ if (qemuMonitorJSONHasError(reply, "CommandNotFound") &&
+ qemuMonitorCheckHMP(mon, "cpu_set")) {
VIR_DEBUG0("cpu_set command not found, trying HMP");
ret = qemuMonitorTextSetCPU(mon, cpu, online);
goto cleanup;
if ((ret = qemuMonitorJSONCommand(mon, cmd, &reply)) < 0)
goto cleanup;
- if (qemuMonitorJSONHasError(reply, "CommandNotFound")) {
+ if (qemuMonitorJSONHasError(reply, "CommandNotFound") &&
+ qemuMonitorCheckHMP(mon, "savevm")) {
VIR_DEBUG0("savevm command not found, trying HMP");
ret = qemuMonitorTextCreateSnapshot(mon, name);
goto cleanup;
if ((ret = qemuMonitorJSONCommand(mon, cmd, &reply)) < 0)
goto cleanup;
- if (qemuMonitorJSONHasError(reply, "CommandNotFound")) {
+ if (qemuMonitorJSONHasError(reply, "CommandNotFound") &&
+ qemuMonitorCheckHMP(mon, "loadvm")) {
VIR_DEBUG0("loadvm command not found, trying HMP");
ret = qemuMonitorTextLoadSnapshot(mon, name);
goto cleanup;
if ((ret = qemuMonitorJSONCommand(mon, cmd, &reply)) < 0)
goto cleanup;
- if (qemuMonitorJSONHasError(reply, "CommandNotFound")) {
+ if (qemuMonitorJSONHasError(reply, "CommandNotFound") &&
+ qemuMonitorCheckHMP(mon, "delvm")) {
VIR_DEBUG0("delvm command not found, trying HMP");
ret = qemuMonitorTextDeleteSnapshot(mon, name);
goto cleanup;
int ret = -1;
if (hmp) {
+ if (!qemuMonitorCheckHMP(mon, NULL)) {
+ qemuReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
+ _("HMP passthrough is not supported by qemu"
+ " process; only QMP commands can be used"));
+ return -1;
+ }
return qemuMonitorJSONHumanCommandWithFd(mon, cmd_str, -1, reply_str);
} else {
if (!(cmd = virJSONValueFromString(cmd_str)))