Commit b7c9b199 by dlezcano

Change at compilation time the destruction of the network devices

From: Daniel Lezcano <dlezcano@fr.ibm.com> The future kernel version will automatically autodestroy the network devices when the network namespace exits. This is not the case for the current version. In order to handle the both cases, I added a configuration option to disable the network destruction when the container exits: --disable-network-destroy Signed-off-by: 's avatarDaniel Lezcano <dlezcano@fr.ibm.com>
parent 6f4a3756
# -*- Autoconf -*- # -*- Autoconf -*-
# Process this file with autoconf to produce a configure script. # Process this file with autoconf to produce a configure script.
AC_INIT([lxc], [0.4.0]) AC_INIT([lxc], [0.4.1])
AC_CONFIG_SRCDIR([configure.in]) AC_CONFIG_SRCDIR([configure.in])
AC_CONFIG_AUX_DIR([config]) AC_CONFIG_AUX_DIR([config])
...@@ -28,6 +28,11 @@ LXC_MAJOR_VERSION=$(echo $PACKAGE_VERSION | cut -d. -f1) ...@@ -28,6 +28,11 @@ LXC_MAJOR_VERSION=$(echo $PACKAGE_VERSION | cut -d. -f1)
LXC_MINOR_VERSION=$(echo $PACKAGE_VERSION | cut -d. -f2) LXC_MINOR_VERSION=$(echo $PACKAGE_VERSION | cut -d. -f2)
LXC_MICRO_VERSION=$(echo $PACKAGE_VERSION | cut -d. -f3) LXC_MICRO_VERSION=$(echo $PACKAGE_VERSION | cut -d. -f3)
AC_ARG_ENABLE(network_destroy, [ --disable-network-destroy disable network destruction at exit [default=no]],, enable_network_destroy=yes)
if test "x$enable_network_destroy" = "xyes"; then
CFLAGS="$CFLAGS -DNETWORK_DESTROY"
fi
AC_SUBST(LXC_MAJOR_VERSION) AC_SUBST(LXC_MAJOR_VERSION)
AC_SUBST(LXC_MINOR_VERSION) AC_SUBST(LXC_MINOR_VERSION)
AC_SUBST(LXC_MICRO_VERSION) AC_SUBST(LXC_MICRO_VERSION)
......
...@@ -218,8 +218,10 @@ wait_again: ...@@ -218,8 +218,10 @@ wait_again:
if (lxc_setstate(name, STOPPING)) if (lxc_setstate(name, STOPPING))
lxc_log_error("failed to set state %s", lxc_state2str(STOPPING)); lxc_log_error("failed to set state %s", lxc_state2str(STOPPING));
#ifdef NETWORK_DESTROY
if (clone_flags & CLONE_NEWNET && conf_destroy_network(name)) if (clone_flags & CLONE_NEWNET && conf_destroy_network(name))
lxc_log_error("failed to destroy the network"); lxc_log_error("failed to destroy the network");
#endif
err = 0; err = 0;
out: out:
...@@ -242,8 +244,10 @@ err_state_failed: ...@@ -242,8 +244,10 @@ err_state_failed:
err_child_failed: err_child_failed:
err_pipe_read2: err_pipe_read2:
err_pipe_write: err_pipe_write:
#ifdef NETWORK_DESTROY
if (clone_flags & CLONE_NEWNET) if (clone_flags & CLONE_NEWNET)
conf_destroy_network(name); conf_destroy_network(name);
#endif
err_create_network: err_create_network:
err_pipe_read: err_pipe_read:
err_waitpid_failed: err_waitpid_failed:
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment