[libvirt] [PATCH 1/2] lxc: Move setting ifname_guest_actual to virLXCSetupInterfaces

so it applies to interfaces of type 'direct' too. Reported and patch provided by Bastian Blank at https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=769600 --- 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 1c0d4e5..c3818a5 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, @@ -432,6 +430,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) -- 2.1.3

On Fri, Dec 19, 2014 at 10:45:55AM +0100, Guido Günther wrote:
so it applies to interfaces of type 'direct' too.
Reported and patch provided by Bastian Blank at
https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=769600 --- 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 1c0d4e5..c3818a5 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, @@ -432,6 +430,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)
ping? -- Guido

On 19.12.2014 10:45, Guido Günther wrote:
so it applies to interfaces of type 'direct' too.
Reported and patch provided by Bastian Blank at
https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=769600 --- 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 1c0d4e5..c3818a5 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, @@ -432,6 +430,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)
ACK Michal

On Mon, Jan 12, 2015 at 10:42:11AM +0100, Michal Privoznik wrote:
On 19.12.2014 10:45, Guido Günther wrote:
so it applies to interfaces of type 'direct' too.
Reported and patch provided by Bastian Blank at
https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=769600 --- 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 1c0d4e5..c3818a5 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, @@ -432,6 +430,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)
ACK
Pushed. Thanks, -- Guido
participants (2)
-
Guido Günther
-
Michal Privoznik