[Pkg-libvirt-commits] [libvirt] 01/01: lxc: Fix crash when using interface type 'direct'

Guido Guenther agx at moszumanska.debian.org
Fri Dec 19 09:42:41 UTC 2014


This is an automated email from the git hooks/post-receive script.

agx pushed a commit to branch experimental
in repository libvirt.

commit 1377d56ee228e11a630d9c8cc0d48ae4717b18a0
Author: Guido Günther <agx at sigxcpu.org>
Date:   Fri Dec 19 10:40:24 2014 +0100

    lxc: Fix crash when using interface type 'direct'
    
    Thanks: Bastian Blank for the patch
    Closes; #769600
---
 ...c-Don-t-crash-on-NULL-ifname_guest_actual.patch | 21 ++++++++++++++
 ...tting-ifname_guest_actual-to-virLXCSetupI.patch | 32 ++++++++++++++++++++++
 debian/patches/series                              |  2 ++
 3 files changed, 55 insertions(+)

diff --git a/debian/patches/lxc-Don-t-crash-on-NULL-ifname_guest_actual.patch b/debian/patches/lxc-Don-t-crash-on-NULL-ifname_guest_actual.patch
new file mode 100644
index 0000000..26a9ffe
--- /dev/null
+++ b/debian/patches/lxc-Don-t-crash-on-NULL-ifname_guest_actual.patch
@@ -0,0 +1,21 @@
+From: =?utf-8?q?Guido_G=C3=BCnther?= <agx at sigxcpu.org>
+Date: Fri, 19 Dec 2014 10:11:42 +0100
+Subject: lxc: Don't crash on NULL ifname_guest_actual
+
+---
+ src/lxc/lxc_container.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/src/lxc/lxc_container.c b/src/lxc/lxc_container.c
+index 3b08b86..cccf327 100644
+--- a/src/lxc/lxc_container.c
++++ b/src/lxc/lxc_container.c
+@@ -472,7 +472,7 @@ lxcContainerGetNetDef(virDomainDefPtr vmDef, const char *devName)
+ 
+     for (i = 0; i < vmDef->nnets; i++) {
+         netDef = vmDef->nets[i];
+-        if (STREQ(netDef->ifname_guest_actual, devName))
++        if (netDef->ifname_guest_actual && STREQ(netDef->ifname_guest_actual, devName))
+             return netDef;
+     }
+ 
diff --git a/debian/patches/lxc-Move-setting-ifname_guest_actual-to-virLXCSetupI.patch b/debian/patches/lxc-Move-setting-ifname_guest_actual-to-virLXCSetupI.patch
new file mode 100644
index 0000000..ccc475b
--- /dev/null
+++ b/debian/patches/lxc-Move-setting-ifname_guest_actual-to-virLXCSetupI.patch
@@ -0,0 +1,32 @@
+From: =?utf-8?q?Guido_G=C3=BCnther?= <agx at sigxcpu.org>
+Date: Fri, 19 Dec 2014 10:08:38 +0100
+Subject: lxc: Move setting ifname_guest_actual to virLXCSetupInterfaces
+
+so it applies to interfaces of type 'direct' too.
+---
+ src/lxc/lxc_process.c | 5 +++--
+ 1 file changed, 3 insertions(+), 2 deletions(-)
+
+diff --git a/src/lxc/lxc_process.c b/src/lxc/lxc_process.c
+index 632fc17..d09a890 100644
+--- a/src/lxc/lxc_process.c
++++ b/src/lxc/lxc_process.c
+@@ -260,8 +260,6 @@ char *virLXCProcessSetupInterfaceBridged(virConnectPtr conn,
+ 
+     if (virNetDevSetMAC(containerVeth, &net->mac) < 0)
+         goto cleanup;
+-    if (VIR_STRDUP(net->ifname_guest_actual, containerVeth) < 0)
+-        goto cleanup;
+ 
+     if (vport && vport->virtPortType == VIR_NETDEV_VPORT_PROFILE_OPENVSWITCH) {
+         if (virNetDevOpenvswitchAddPort(brname, parentVeth, &net->mac,
+@@ -430,6 +428,9 @@ static int virLXCProcessSetupInterfaces(virConnectPtr conn,
+ 
+         (*veths)[(*nveths)-1] = veth;
+ 
++        if (VIR_STRDUP(def->nets[i]->ifname_guest_actual, veth) < 0)
++            goto cleanup;
++
+         /* Make sure all net definitions will have a name in the container */
+         if (!net->ifname_guest) {
+             if (virAsprintf(&net->ifname_guest, "eth%zu", niface) < 0)
diff --git a/debian/patches/series b/debian/patches/series
index 86e77c7..3b23e3f 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -11,3 +11,5 @@ debian/Debianize-systemd-service-files.patch
 Allow-xen-toolstack-to-find-it-s-binaries.patch
 Skip-vircgrouptest.patch
 debian/Debianize-virtlockd.patch
+lxc-Move-setting-ifname_guest_actual-to-virLXCSetupI.patch
+lxc-Don-t-crash-on-NULL-ifname_guest_actual.patch

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-libvirt/libvirt.git



More information about the Pkg-libvirt-commits mailing list