Package: libvirt
Version: 0.9.8-2
Severity: normal
Tags: patch
User: [email protected]
Usertags: origin-ubuntu precise ubuntu-patch
Dear Maintainer,
libvirt uses xend (xm stack) to manage Xen instances. Even when using
any emulated NIC, there will always be a paravirt NIC in parallel if the
pci-platform device is present. Newer guests will unplug the emulated
NIC on boot. However there is a bug in the stack that will cause the
paravirt NIC to have no MAC address when "type=ioemu" is used in the
vif definition. On the other hand, even without this keyword, the
emulated NIC will be provided.
Current libvirt already has a quirk to drop this when using no specific
NIC model (defaulting to rtl8139). But the problem exists as well when
using any other emulated NIC.
So currently, when booting a 3.0+ kernel after setting up the instance
with the default NIC model, everything works. Changing the model to
something like e1000, then the guest cannot use the paravirt interface
after unplugging the emulated one. Ending up with no network.
*** /tmp/tmpay_5Gn/bug_body
In Ubuntu, the attached patch was applied to achieve the following:
The parch replicates the quirk used to prevent the usage of "type=ioemu"
to be used for the case of using a NIC model name explicitely.
I think it should be useful/working for Debian as well. Sorry if this
is not the ideal justification. Since this is the first time I use
submittodebian, I am not sure how this exactly should be done.
[ Stefan Bader ]
* Never use type=ioemu for NIC definitions. It is not needed
and actually breaks the paravirt interface which always gets
created in parallel.
Thanks for considering the patch.
-- System Information:
Debian Release: wheezy/sid
APT prefers precise-updates
APT policy: (500, 'precise-updates'), (500, 'precise-security'), (500,
'precise-proposed'), (500, 'precise')
Architecture: amd64 (x86_64)
Kernel: Linux 3.2.0-18-generic (SMP w/2 CPU cores)
Locale: LANG=de_DE.UTF-8, LC_CTYPE=de_DE.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash
diff -Nru libvirt-0.9.8/debian/changelog libvirt-0.9.8/debian/changelog
diff -Nru libvirt-0.9.8/debian/patches/series libvirt-0.9.8/debian/patches/series
--- libvirt-0.9.8/debian/patches/series 2012-03-02 15:49:27.000000000 +0100
+++ libvirt-0.9.8/debian/patches/series 2012-03-08 15:36:16.000000000 +0100
@@ -26,3 +26,4 @@
ubuntu/xen_hypervisor-treat-missing-privcmd-file-as-temporary.patch
ubuntu/dnsmasq-as-priv-user
rewrite-lxc-controller-eof-handling-yet-again
+ubuntu/xen-vif-ioemu-deprecated.patch
diff -Nru libvirt-0.9.8/debian/patches/ubuntu/xen-vif-ioemu-deprecated.patch libvirt-0.9.8/debian/patches/ubuntu/xen-vif-ioemu-deprecated.patch
--- libvirt-0.9.8/debian/patches/ubuntu/xen-vif-ioemu-deprecated.patch 1970-01-01 01:00:00.000000000 +0100
+++ libvirt-0.9.8/debian/patches/ubuntu/xen-vif-ioemu-deprecated.patch 2012-03-08 15:36:16.000000000 +0100
@@ -0,0 +1,41 @@
+UBUNTU: Suppress ioemu agrument even when model name given
+
+A strange bug in the xm stack will cause the paravirt interface
+to have no MAC address when type=ioemu is used in the vif definition.
+However for the default emulation and any other hw emulated NIC,
+there will always be a paravirtualized NIC present. And the guest
+will unplug the emulated interfaces when the platform device
+is present. In short type=ioemu only can hurt, it never adds
+anything that would not be done anyways.
+
+Signed-off-by: Stefan Bader <[email protected]>
+Index: libvirt-0.9.8/src/xenxs/xen_sxpr.c
+===================================================================
+--- libvirt-0.9.8.orig/src/xenxs/xen_sxpr.c 2011-11-22 02:52:24.000000000 +0100
++++ libvirt-0.9.8/src/xenxs/xen_sxpr.c 2012-03-07 15:03:01.460285542 +0100
+@@ -1873,7 +1873,9 @@
+ }
+ else {
+ virBufferEscapeSexpr(buf, "(model '%s')", def->model);
+- virBufferAddLit(buf, "(type ioemu)");
++ /* See above. Also needed when model is specified. */
++ if (xendConfigVersion <= XEND_CONFIG_MAX_VERS_NET_TYPE_IOEMU)
++ virBufferAddLit(buf, "(type ioemu)");
+ }
+
+ if (!isAttach)
+Index: libvirt-0.9.8/src/xenxs/xen_xm.c
+===================================================================
+--- libvirt-0.9.8.orig/src/xenxs/xen_xm.c 2011-11-22 02:52:24.000000000 +0100
++++ libvirt-0.9.8/src/xenxs/xen_xm.c 2012-03-07 15:03:49.872285557 +0100
+@@ -1335,7 +1335,9 @@
+ }
+ else {
+ virBufferAsprintf(&buf, ",model=%s", net->model);
+- virBufferAddLit(&buf, ",type=ioemu");
++ /* See above. Also needed if model is specified. */
++ if (xendConfigVersion <= XEND_CONFIG_MAX_VERS_NET_TYPE_IOEMU)
++ virBufferAddLit(&buf, ",type=ioemu");
+ }
+
+ if (net->ifname)