Re: [PATCH] qemu: don't attempt undefined QMP commands

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Thu, Nov 29, 2012 at 05:40:20PM -0700, Eric Blake wrote:
> https://bugzilla.redhat.com/show_bug.cgi?id=872292
> 
> Libvirt should not attempt to call a QMP command that has not been
> documented in qemu.git - if future qemu introduces a command by the
> same name but with subtly different semantics, then libvirt will be
> broken when trying to use that command.

The reason these were added was that back in the first days of QMP
the intention was that every HMP command would have an identical
QMP command. This plan changed before it was ever completed, hence
the situation we're in now.


> diff --git a/src/qemu/qemu_monitor.c b/src/qemu/qemu_monitor.c
> index aef5044..43e45ef 100644
> --- a/src/qemu/qemu_monitor.c
> +++ b/src/qemu/qemu_monitor.c
> @@ -2387,7 +2387,8 @@ int qemuMonitorAddHostNetwork(qemuMonitorPtr mon,
>      }
> 
>      if (mon->json)
> -        ret = qemuMonitorJSONAddHostNetwork(mon, netstr);
> +        virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
> +                       _("JSON monitor should be using netdev_add"));
>      else
>          ret = qemuMonitorTextAddHostNetwork(mon, netstr);
> 
> @@ -2418,7 +2419,8 @@ int qemuMonitorRemoveHostNetwork(qemuMonitorPtr mon,
>      }
> 
>      if (mon->json)
> -        ret = qemuMonitorJSONRemoveHostNetwork(mon, vlan, netname);
> +        virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
> +                       _("JSON monitor should be using netdev_del"));

In these two you recommend different commands

>      else
>          ret = qemuMonitorTextRemoveHostNetwork(mon, vlan, netname);
>      return ret;
> @@ -2548,7 +2550,8 @@ int qemuMonitorAttachDrive(qemuMonitorPtr mon,
>      }
> 
>      if (mon->json)
> -        ret = qemuMonitorJSONAttachDrive(mon, drivestr, controllerAddr, driveAddr);
> +        virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
> +                       _("JSON monitor should be using AddDrive"));

while this one recommends a different method


ACK you standardize on one.

Daniel
-- 
|: http://berrange.com      -o-    http://www.flickr.com/photos/dberrange/ :|
|: http://libvirt.org              -o-             http://virt-manager.org :|
|: http://autobuild.org       -o-         http://search.cpan.org/~danberr/ :|
|: http://entangle-photo.org       -o-       http://live.gnome.org/gtk-vnc :|

--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list


[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]