Add -netdev bridge capabilities

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>
This commit is contained in:
Richa Marwaha 2012-08-03 16:33:05 -04:00 committed by Michal Privoznik
parent 87de27b7f9
commit 756fe7868b
4 changed files with 13 additions and 5 deletions

View File

@ -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....]

View 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"))

View 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 */
};

View 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;
}