[lxc-devel] [PATCH 2/6] Add cgroup.pattern global configuration option

Christian Seiler christian at iwakd.de
Sun Sep 8 19:44:40 UTC 2013


Signed-off-by: Christian Seiler <christian at iwakd.de>
---
 configure.ac        |    7 +++++++
 src/lxc/Makefile.am |    3 ++-
 src/lxc/utils.c     |    1 +
 3 files changed, 10 insertions(+), 1 deletion(-)

diff --git a/configure.ac b/configure.ac
index 4eaf329..f0f417c 100644
--- a/configure.ac
+++ b/configure.ac
@@ -260,6 +260,12 @@ AC_ARG_WITH([rootfs-path],
 		[--with-rootfs-path=dir],
 		[lxc rootfs mount point]
 	)], [], [with_rootfs_path=['${libdir}/lxc/rootfs']])
+# cgroup pattern specification
+AC_ARG_WITH([cgroup-pattern],
+	[AC_HELP_STRING(
+		[--with-cgroup-pattern=pattern],
+		[pattern for container cgroups]
+	)], [], [with_cgroup_pattern=['/lxc/%n']])
 
 # Container log path.  By default, use $lxcpath.
 AC_MSG_CHECKING([Whether to place logfiles in container config path])
@@ -303,6 +309,7 @@ AS_AC_EXPAND(LXCTEMPLATEDIR, "$datadir/lxc/templates")
 AS_AC_EXPAND(LXCHOOKDIR, "$datadir/lxc/hooks")
 AS_AC_EXPAND(LXCINITDIR, "$libexecdir")
 AS_AC_EXPAND(LOGPATH, "$with_log_path")
+AC_SUBST(DEFAULT_CGROUP_PATTERN, ["$with_cgroup_pattern"])
 
 # Check for some standard kernel headers
 AC_CHECK_HEADERS([linux/unistd.h linux/netlink.h linux/genetlink.h],
diff --git a/src/lxc/Makefile.am b/src/lxc/Makefile.am
index da5ff15..8ee279f 100644
--- a/src/lxc/Makefile.am
+++ b/src/lxc/Makefile.am
@@ -100,7 +100,8 @@ AM_CFLAGS=-I$(top_srcdir)/src \
 	-DLOGPATH=\"$(LOGPATH)\" \
 	-DLXC_DEFAULT_CONFIG=\"$(LXC_DEFAULT_CONFIG)\" \
 	-DLXC_USERNIC_DB=\"$(LXC_USERNIC_DB)\" \
-	-DLXC_USERNIC_CONF=\"$(LXC_USERNIC_CONF)\"
+	-DLXC_USERNIC_CONF=\"$(LXC_USERNIC_CONF)\" \
+	-DDEFAULT_CGROUP_PATTERN=\"$(DEFAULT_CGROUP_PATTERN)\"
 
 if ENABLE_APPARMOR
 AM_CFLAGS += -DHAVE_APPARMOR
diff --git a/src/lxc/utils.c b/src/lxc/utils.c
index fd892c1..36d80b9 100644
--- a/src/lxc/utils.c
+++ b/src/lxc/utils.c
@@ -225,6 +225,7 @@ const char *lxc_global_config_value(const char *option_name)
 		{ "lvm_vg",          DEFAULT_VG      },
 		{ "zfsroot",         DEFAULT_ZFSROOT },
 		{ "lxcpath",         LXCPATH         },
+		{ "cgroup.pattern",  DEFAULT_CGROUP_PATTERN },
 		{ NULL, NULL },
 	};
 	static const char *values[sizeof(options) / sizeof(options[0])] = { 0 };
-- 
1.7.10.4





More information about the lxc-devel mailing list