1
0
mirror of https://gitlab.com/libvirt/libvirt.git synced 2025-03-20 06:50:22 +03:00

qemu: Fallback to HMP when cpu_set QMP command is not found

This commit is contained in:
Wen Congyang 2011-03-15 16:53:06 +08:00 committed by Eric Blake
parent a9c32b5d62
commit ce81bc5ce8

View File

@ -1450,7 +1450,14 @@ int qemuMonitorJSONSetCPU(qemuMonitorPtr mon,
if (!cmd)
return -1;
ret = qemuMonitorJSONCommand(mon, cmd, &reply);
if ((ret = qemuMonitorJSONCommand(mon, cmd, &reply)) < 0)
goto cleanup;
if (qemuMonitorJSONHasError(reply, "CommandNotFound")) {
VIR_DEBUG0("cpu_set command not found, trying HMP");
ret = qemuMonitorTextSetCPU(mon, cpu, online);
goto cleanup;
}
if (ret == 0) {
/* XXX See if CPU soft-failed due to lack of ACPI */
@ -1468,10 +1475,7 @@ int qemuMonitorJSONSetCPU(qemuMonitorPtr mon,
ret = 1;
}
#if 0
cleanup:
#endif
virJSONValueFree(cmd);
virJSONValueFree(reply);
return ret;