[libvirt] [PATCH 05/14] Add checks for some NIC hotplug related features added in qemu-0.10.0

Daniel Veillard veillard at redhat.com
Mon Jul 20 12:39:51 UTC 2009


On Mon, Jul 20, 2009 at 12:51:15PM +0100, Mark McLoughlin wrote:
> Add QEMUD_CMD_FLAG_NET_NAME to indicate that '-net ...,name=foo' is
> supported and QEMUD_CMD_FLAG_HOST_NET_ADD to indicate that the
> 'host_net_add' monitor command is available.
> 
> Set both these flags if the qemu version is greater than 0.10.0.
> Checking via the '-help' output would not work for the monitor command
> and even for the command line arg, it would be quite fragile.
> 
> * src/qemu_conf.h: add new flags as aliases of QEMUD_CMD_FLAG_0_10
> 
> * src/qemu_conf.c: set QEMUD_CMD_FLAG_0_10 for versions >= 0.10.0
> 
> * tests/qemuhelptest.c: set QEMUD_CMD_FLAG_0_10 for the appropriate
>   qemu versions
[...]
> --- a/src/qemu_conf.h
> +++ b/src/qemu_conf.h
> @@ -58,6 +58,11 @@ enum qemud_cmd_flags {
>      QEMUD_CMD_FLAG_KVM               = (1 << 13), /* Whether KVM is compiled in */
>      QEMUD_CMD_FLAG_DRIVE_FORMAT      = (1 << 14), /* Is -drive format= avail */
>      QEMUD_CMD_FLAG_VGA               = (1 << 15), /* Is -vga avail */
> +
> +    /* features added in qemu-0.10.0 */
> +    QEMUD_CMD_FLAG_0_10         = (1 << 16),
> +    QEMUD_CMD_FLAG_NET_NAME     = QEMUD_CMD_FLAG_0_10, /* -net ...,name=str */
> +    QEMUD_CMD_FLAG_HOST_NET_ADD = QEMUD_CMD_FLAG_0_10, /* host_net_add monitor command */
>  };

   Hum, defining multiple time the same value in an enum, maybe that's
fine but that looks weird to me, especially as each entry so far was
about separated capabilities, independantly of the potential version.

   Not a big deal but what do others think ?

Daniel

-- 
Daniel Veillard      | libxml Gnome XML XSLT toolkit  http://xmlsoft.org/
daniel at veillard.com  | Rpmfind RPM search engine http://rpmfind.net/
http://veillard.com/ | virtualization library  http://libvirt.org/




More information about the libvir-list mailing list