[libvirt] [PATCH] qemu: Fallback to HMP when cpu_set QMP command is not found
Eric Blake
eblake at redhat.com
Tue Mar 15 16:12:03 UTC 2011
On 03/15/2011 02:53 AM, Wen Congyang wrote:
> ---
> src/qemu/qemu_monitor_json.c | 12 ++++++++----
> 1 files changed, 8 insertions(+), 4 deletions(-)
>
> diff --git a/src/qemu/qemu_monitor_json.c b/src/qemu/qemu_monitor_json.c
> index a839ffe..13d12c8 100644
> --- a/src/qemu/qemu_monitor_json.c
> +++ b/src/qemu/qemu_monitor_json.c
> @@ -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;
> + }
ACK and applied.
--
Eric Blake eblake at redhat.com +1-801-349-2682
Libvirt virtualization library http://libvirt.org
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 619 bytes
Desc: OpenPGP digital signature
URL: <http://listman.redhat.com/archives/libvir-list/attachments/20110315/bb152499/attachment-0001.sig>
More information about the libvir-list
mailing list