[lxc-devel] lxc-1.0.0 reboot error

Stéphane Graber stgraber at ubuntu.com
Sat Feb 22 23:36:33 UTC 2014


Hi,

Thanks for your patch.

Can I just ask you to sign it off? (Signed-off-by: Name <email>)

Thanks.

On Sat, Feb 22, 2014 at 03:46:22PM +0400, Vitaly Lavrov wrote:
> if you try to reboot the container having a network interface type vlan, then the container will be halted.
> 
> Tested on kernels 3.10.x and 3.12.x
> 
> Suggest a patch to fix this problem and fix warnings for network interfaces type veth.
> 

> diff --git a/src/lxc/conf.c b/src/lxc/conf.c
> index 046d8dd..f4d4f54 100644
> --- a/src/lxc/conf.c
> +++ b/src/lxc/conf.c
> @@ -2910,9 +2910,11 @@ static int instanciate_vlan(struct lxc_handler *handler, struct lxc_netdev *netd
>  
>  	err = lxc_vlan_create(netdev->link, peer, netdev->priv.vlan_attr.vid);
>  	if (err) {
> -		ERROR("failed to create vlan interface '%s' on '%s' : %s",
> -		      peer, netdev->link, strerror(-err));
> -		return -1;
> +		if(!(handler->conf->reboot && err == -EEXIST)) {
> +			ERROR("failed to create vlan interface '%s' on '%s' : %s",
> +			      peer, netdev->link, strerror(-err));
> +			return -1;
> +		}
>  	}
>  
>  	netdev->ifindex = if_nametoindex(peer);
> @@ -3089,13 +3091,15 @@ void lxc_delete_network(struct lxc_handler *handler)
>  		if (netdev_deconf[netdev->type](handler, netdev)) {
>  			WARN("failed to destroy netdev");
>  		}
> +		if (!netdev->ifindex) continue;
> +		if ( netdev->type == LXC_NET_VLAN || netdev->type == LXC_NET_VETH) 
> +			continue;
>  
>  		/* Recent kernel remove the virtual interfaces when the network
>  		 * namespace is destroyed but in case we did not moved the
>  		 * interface to the network namespace, we have to destroy it
>  		 */
> -		if (netdev->ifindex != 0 &&
> -		    lxc_netdev_delete_by_index(netdev->ifindex))
> +		if (lxc_netdev_delete_by_index(netdev->ifindex))
>  			WARN("failed to remove interface '%s'", netdev->name);
>  	}
>  }

> _______________________________________________
> lxc-devel mailing list
> lxc-devel at lists.linuxcontainers.org
> http://lists.linuxcontainers.org/listinfo/lxc-devel


-- 
Stéphane Graber
Ubuntu developer
http://www.ubuntu.com
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: Digital signature
URL: <http://lists.linuxcontainers.org/pipermail/lxc-devel/attachments/20140222/0c0bd639/attachment.pgp>


More information about the lxc-devel mailing list