[libvirt] [PATCH] Fix netdev detection on RHEL6x versions of qemu
Daniel P. Berrange
berrange at redhat.com
Tue May 24 09:10:02 UTC 2011
On Tue, May 24, 2011 at 07:16:28AM +0100, Neil Wilson wrote:
> This allows the attach-device derived functions to work on the vanilla
> RHEL6 versions of qemu. Looking for the '-spice' parameter differentiates
> the RHEL from non-RHEL versions.
>
> Signed-off-by: Neil Wilson <neil at brightbox.co.uk>
> ---
> src/qemu/qemu_capabilities.c | 7 ++++---
> tests/qemuhelptest.c | 2 ++
> 2 files changed, 6 insertions(+), 3 deletions(-)
>
> diff --git a/src/qemu/qemu_capabilities.c b/src/qemu/qemu_capabilities.c
> index 71a54a5..587de9e 100644
> --- a/src/qemu/qemu_capabilities.c
> +++ b/src/qemu/qemu_capabilities.c
> @@ -962,10 +962,11 @@ qemuCapsComputeCmdFlags(const char *help,
> qemuCapsSet(flags, QEMU_CAPS_SMBIOS_TYPE);
>
> if (strstr(help, "-netdev")) {
> - /* Disable -netdev on 0.12 since although it exists,
> - * the corresponding netdev_add/remove monitor commands
> + /* Disable -netdev on non-RHEL6 versions of 0.12 since although
> + * it exists,the corresponding netdev_add/remove monitor commands
> * do not, and we need them to be able todo hotplug */
> - if (version >= 13000)
> + if ((version >= 13000) ||
> + ((version >= 12001) && (strstr(help, "-spice"))))
> qemuCapsSet(flags, QEMU_CAPS_NETDEV);
> }
>
> diff --git a/tests/qemuhelptest.c b/tests/qemuhelptest.c
> index 2522396..ceed35f 100644
> --- a/tests/qemuhelptest.c
> +++ b/tests/qemuhelptest.c
> @@ -331,6 +331,7 @@ mymain(void)
> QEMU_CAPS_ENABLE_KVM,
> QEMU_CAPS_BALLOON,
> QEMU_CAPS_DEVICE,
> + QEMU_CAPS_NETDEV,
> QEMU_CAPS_SMP_TOPOLOGY,
> QEMU_CAPS_RTC,
> QEMU_CAPS_VNET_HOST,
> @@ -454,6 +455,7 @@ mymain(void)
> QEMU_CAPS_ENABLE_KVM,
> QEMU_CAPS_BALLOON,
> QEMU_CAPS_DEVICE,
> + QEMU_CAPS_NETDEV,
> QEMU_CAPS_SMP_TOPOLOGY,
> QEMU_CAPS_RTC,
> QEMU_CAPS_VNET_HOST,
IMHO RHEL specific hacks don't belong in upstream libvirt code.
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