[libvirt] [PATCH 6/6] Use help string "-device driver, " when getting additional caps.

Daniel P. Berrange berrange at redhat.com
Thu Dec 20 10:32:57 UTC 2012


On Thu, Dec 20, 2012 at 02:02:27PM +0800, Li Zhang wrote:
> From: Li Zhang <zhlcindy at linux.vnet.ibm.com>
> 
> QEMU of upstream and PPC64 can support "-device driver,?",
> But the help string is "-device driver,help",
> 
> This patch is to replace "-device driver,?" with "-device driver,".
> 
> Signed-off-by: Li Zhang <zhlcindy at linux.vnet.ibm.com>
> ---
>  src/qemu/qemu_capabilities.c |    4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/src/qemu/qemu_capabilities.c b/src/qemu/qemu_capabilities.c
> index a6ac169..839c966 100644
> --- a/src/qemu/qemu_capabilities.c
> +++ b/src/qemu/qemu_capabilities.c
> @@ -1599,7 +1599,7 @@ qemuCapsExtractDeviceStr(const char *qemu,
>       * in combination with '-device ?'.  Upstream qemu 0.12.x doesn't
>       * understand '-device name,?', and always exits with status 1 for
>       * the simpler '-device ?', so this function is really only useful
> -     * if -help includes "device driver,?".  */
> +     * if -help includes "device driver,".  */
>      cmd = qemuCapsProbeCommand(qemu, caps, hookData);
>      virCommandAddArgList(cmd,
>                           "-device", "?",
> @@ -2186,7 +2186,7 @@ qemuCapsInitHelp(qemuCapsPtr caps, uid_t runUid, gid_t runGid)
>      /* qemuCapsExtractDeviceStr will only set additional caps if qemu
>       * understands the 0.13.0+ notion of "-device driver,".  */
>      if (qemuCapsGet(caps, QEMU_CAPS_DEVICE) &&
> -        strstr(help, "-device driver,?") &&
> +        strstr(help, "-device driver,") &&
>          qemuCapsExtractDeviceStr(caps->binary, caps, &hookData) < 0)
>          goto cleanup;

NACK.

For any QEMU version where the help text shows 'driver,help' we should
be using QMP to determine capabilities.

The -help parsing is only for legacy QEMU versions

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 :|




More information about the libvir-list mailing list