]> xenbits.xensource.com Git - libvirt.git/commitdiff
Add -netdev bridge capabilities
authorRicha Marwaha <rmarwah@linux.vnet.ibm.com>
Fri, 3 Aug 2012 20:33:05 +0000 (16:33 -0400)
committerMichal Privoznik <mprivozn@redhat.com>
Mon, 6 Aug 2012 14:56:59 +0000 (16:56 +0200)
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>
AUTHORS
src/qemu/qemu_capabilities.c
src/qemu/qemu_capabilities.h
tests/qemuhelptest.c

diff --git a/AUTHORS b/AUTHORS
index e3eadbf76900d23a7b7c09e13bbba7aa115432f7..1a7a4aceb5c719fd2590291c4559d0292f60fc45 100644 (file)
--- a/AUTHORS
+++ b/AUTHORS
@@ -252,6 +252,7 @@ Patches have also been contributed by:
   Sebastian Wiedenroth <wiedi@frubar.net>
   Ata E Husain Bohra   <ata.husain@hotmail.com>
   Ján Tomko            <jtomko@redhat.com>
+  Richa Marwaha        <rmarwah@linux.vnet.ibm.com>
 
   [....send patches to get your name here....]
 
index 85c49a270210bd11bc7361fdaeac6cc5740c9ee8..82a28705318c474d32f55dd1097f1dd5a2113b39 100644 (file)
@@ -169,6 +169,8 @@ VIR_ENUM_IMPL(qemuCaps, QEMU_CAPS_LAST,
               "virtio-s390",
               "balloon-event",
 
+              "bridge", /* 100 */
+
     );
 
 struct qemu_feature_flags {
@@ -1020,7 +1022,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);
@@ -1133,13 +1135,16 @@ 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);
+           qemuCapsSet(flags, QEMU_CAPS_NETDEV);
+        }
     }
 
     if (strstr(help, "-sdl"))
index e8251dc733d461feb21f9151f54888e85c08f983..c1b67a69752a8123ae1f4aef986a65ab7e7075f6 100644 (file)
@@ -135,6 +135,7 @@ enum qemuCapsFlags {
     QEMU_CAPS_NEC_USB_XHCI       = 97, /* -device nec-usb-xhci */
     QEMU_CAPS_VIRTIO_S390        = 98, /* -device virtio-*-s390 */
     QEMU_CAPS_BALLOON_EVENT      = 99, /* Async event for balloon changes */
+    QEMU_CAPS_NETDEV_BRIDGE      = 100, /* bridge helper support */
 
     QEMU_CAPS_LAST,                   /* this must always be the last item */
 };
index 012ba2695d304aefaaeb392faa0b6b5b711233ec..75c818ccd532cb53d73d19bbd48f3fba7449bc92 100644 (file)
@@ -754,7 +754,8 @@ mymain(void)
             QEMU_CAPS_IDE_CD,
             QEMU_CAPS_NO_USER_CONFIG,
             QEMU_CAPS_HDA_MICRO,
-            QEMU_CAPS_NEC_USB_XHCI);
+            QEMU_CAPS_NEC_USB_XHCI,
+            QEMU_CAPS_NETDEV_BRIDGE);
 
     return ret == 0 ? EXIT_SUCCESS : EXIT_FAILURE;
 }