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

Re: [libvirt] [Patch v2 1/3] Add -netdev bridge capabilities



On 29.06.2012 20:08, rmarwah linux vnet ibm com wrote:
> From: Richa Marwaha <rmarwah linux vnet ibm com>
> 
> This patch adds the capability in libvirt to check if
> -netdev bridge option is supported or not.
> 
> Signed-off-by: Richa Marwaha <rmarwah linux vnet ibm com>
> Signed-off-by: Corey Bryant<coreyb linux vnet ibm com>
> ---
> v2
> -This is a new patch that helps libvirt to check if -netdev bridge
> option is supported in the qemu version that is being used to run
> the guest. In v1 we didnot have the capability to check if qemu
> version we are using supported -netdev bridge or not.
> 
>  src/qemu/qemu_capabilities.c |   13 +++++++++----
>  src/qemu/qemu_capabilities.h |    1 +
>  2 files changed, 10 insertions(+), 4 deletions(-)
> 
> diff --git a/src/qemu/qemu_capabilities.c b/src/qemu/qemu_capabilities.c
> index 1e12a39..b2d7be2 100644
> --- a/src/qemu/qemu_capabilities.c
> +++ b/src/qemu/qemu_capabilities.c
> @@ -166,6 +166,7 @@ VIR_ENUM_IMPL(qemuCaps, QEMU_CAPS_LAST,
>                "hda-micro", /* 95 */
>                "dump-guest-memory",
>                "nec-usb-xhci",
> +              "bridge",
>  
>      );
>  
> @@ -1005,7 +1006,7 @@ qemuCapsComputeCmdFlags(const char *help,
>                          bool check_yajl ATTRIBUTE_UNUSED)
>  {
>      const char *p;
> -    const char *fsdev;
> +    const char *fsdev, *netdev;
>  
>      if (strstr(help, "-no-kqemu"))
>          qemuCapsSet(flags, QEMU_CAPS_KQEMU);
> @@ -1118,13 +1119,17 @@ qemuCapsComputeCmdFlags(const char *help,
>      if (strstr(help, "-smbios type"))
>          qemuCapsSet(flags, QEMU_CAPS_SMBIOS_TYPE);
>  
> -    if (strstr(help, "-netdev")) {
> +    if ((netdev = strstr(help, "-netdev"))) {
>          /* Disable -netdev on 0.12 since although it exists,
>           * the corresponding netdev_add/remove monitor commands
>           * do not, and we need them to be able to do hotplug.
>           * But see below about RHEL build. */
> -        if (version >= 13000)
> -            qemuCapsSet(flags, QEMU_CAPS_NETDEV);
> +        if (version >= 13000) {
> +            if (strstr (netdev, "bridge"))
> +                qemuCapsSet(flags, QEMU_CAPS_NETDEV_BRIDGE);
> +            else
> +                qemuCapsSet(flags, QEMU_CAPS_NETDEV);
> +        }
>      }

I think we want both capabilities set as QEMU_CAPS_NETDEV is used later
in the code. Moreover, QEMU_CAPS_NETDEV_BRIDGE is just refined version
of QEMU_CAPS_NETDEV. That is, if QEMU_CAPS_NETDEV_BRIDGE is set,
QEMU_CAPS_NETDEV must be supported as well.

>  
>      if (strstr(help, "-sdl"))
> diff --git a/src/qemu/qemu_capabilities.h b/src/qemu/qemu_capabilities.h
> index 83c135b..458a73e 100644
> --- a/src/qemu/qemu_capabilities.h
> +++ b/src/qemu/qemu_capabilities.h
> @@ -133,6 +133,7 @@ enum qemuCapsFlags {
>      QEMU_CAPS_HDA_MICRO          = 95, /* -device hda-micro */
>      QEMU_CAPS_DUMP_GUEST_MEMORY  = 96, /* dump-guest-memory command */
>      QEMU_CAPS_NEC_USB_XHCI       = 97, /* -device nec-usb-xhci */
> +    QEMU_CAPS_NETDEV_BRIDGE      = 98, /* bridge helper support */
>  
>      QEMU_CAPS_LAST,                   /* this must always be the last item */
>  };
> 

You forgot to add yourself to AUTHORS:

diff --git a/AUTHORS b/AUTHORS
index 0e179a9..f59550e 100644
--- a/AUTHORS
+++ b/AUTHORS
@@ -247,6 +247,7 @@ Patches have also been contributed by:
   Viktor Mihajlovski   <mihajlov linux vnet ibm com>
   Thang Pham           <thang pham us ibm com>
   Eiichi Tsukata       <eiichi tsukata xh hitachi com>
+  Richa Marwaha        <rmarwah linux vnet ibm com>

   [....send patches to get your name here....]

And don't forget to update tests/qemuhelptest.c as well.

Michal


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