[libvirt] [PATCH v2 2/3] qemu: Only use HMP passthrough if it is supported

Eric Blake eblake at redhat.com
Mon Mar 21 20:06:16 UTC 2011


On 03/21/2011 06:52 AM, Jiri Denemark wrote:
> Avoids calling text monitor methods when it is know they will not
> succeed and also results in nicer error messages.
> ---
> Notes:
>     Version 2:
>     - new patch
> 

> -    if (qemuMonitorJSONHasError(reply, "CommandNotFound")) {
> +    if (qemuMonitorJSONHasError(reply, "CommandNotFound") &&
> +        qemuMonitorCheckHMP(mon, "cpu_set")) {
>          VIR_DEBUG0("cpu_set command not found, trying HMP");

So either we get a debug message about trying HMP, or we get a debug
message about skipping HMP.  Looks nice.

> @@ -2466,6 +2470,12 @@ int qemuMonitorJSONArbitraryCommand(qemuMonitorPtr mon,
>      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"));

And this is the one place where it becomes a user-visible effect.

ACK.

-- 
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/20110321/226d1642/attachment-0001.sig>


More information about the libvir-list mailing list