Hi,
I've been playing with lxc, though with --enable-test the test/ directory
doesn't compile, the following patch ought to fix this.
I've not tested tests throughly but seems straightforward enough.
Update the API usage in test/ as to make tests compile
Signed-off-by: Daniel Lezcano <dlezcano@fr.ibm.com>
Daniel Lezcano [Thu, 28 May 2009 10:10:50 +0000 (12:10 +0200)]
rename the ns_cgroup with the container name
It is not easy to follow the cgroup name associated with a container,
so right after the container is created, I rename the cgroup which
is the pid of the creator by the container name.
Signed-off-by: Daniel Lezcano <dlezcano@fr.ibm.com>
Daniel Lezcano [Thu, 28 May 2009 10:10:50 +0000 (12:10 +0200)]
change the checkpoint/restart function api
As the checkpoint/restart is expected to be sequential,
I pass the file descriptor to checkpoint and restart, so
that will be up to the caller to open the file descriptor
which can be a pipe, socket, file, etc ...
Signed-off-by: Daniel Lezcano <dlezcano@fr.ibm.com>
Daniel Lezcano [Thu, 28 May 2009 10:10:50 +0000 (12:10 +0200)]
remove checkpoint / restart code
The checkpoint / restart code is too experimental regarding
the current implementation in the kernel.
As there are several implementation and we don't know which
one will be merged upstream, I remove the code and add a few
parameters to checkpoint.
The checkpoint/restart function will be plugins in order to choose
the CR solutions. This approach will allow to switch from one
implementation to another without breaking anything.
Signed-off-by: Daniel Lezcano <dlezcano@fr.ibm.com>
Michel Normand [Mon, 18 May 2009 20:27:35 +0000 (22:27 +0200)]
lxc-execute to report exit code of started application
The exit code of the application as reported by lxc-execute is:
0-126 exit code of the application itself
128+n signal n received by the application
255 lxc error
Note that this is the same type of changes as done
for lxc-start command line.
Signed-off-by: Michel Normand <normand@fr.ibm.com> Signed-off-by: Daniel Lezcano <dlezcano@fr.ibm.com>
Michel Normand [Mon, 18 May 2009 20:27:34 +0000 (22:27 +0200)]
lxc-start to report exit code of started application
The exit code of the application as reported by lxc-start is:
0-126 exit code of the application itself
128+n signal n received by the application
255 lxc error
Signed-off-by: Michel Normand <normand@fr.ibm.com> Signed-off-by: Daniel Lezcano <dlezcano@fr.ibm.com>
Michel Normand [Mon, 18 May 2009 20:11:45 +0000 (22:11 +0200)]
in lxc-unshare remove log options
remove the -o and -l log options in src/lxc-unshared.c
because these are useless for such a basic test command.
It is sufficient to report the error to stderr.
Signed-off-by: Michel Normand <normand@fr.ibm.com> Signed-off-by: Daniel Lezcano <dlezcano@fr.ibm.com>
Michel Normand [Fri, 15 May 2009 08:43:51 +0000 (10:43 +0200)]
properly handle va_list in log_append functions
the support of multiple appenders need to associate
one va_list per appender.
This is the purpose of this patch to copy the va_list
before to call the appender.
Signed-off-by: Michel Normand <normand@fr.ibm.com> Signed-off-by: Daniel Lezcano <dlezcano@fr.ibm.com>
Michel Normand [Thu, 14 May 2009 13:52:03 +0000 (15:52 +0200)]
remove fprintf to stderr and replace by ERROR call when needed
do it in all cli, except:
* the usage functions that will be removed by another patch
* the lxc_init that need more work
* the lxc_priority that is not used anymore
Signed-off-by: Michel Normand <normand@fr.ibm.com> Signed-off-by: Daniel Lezcano <dlezcano@fr.ibm.com>
Michel Normand [Thu, 14 May 2009 13:11:40 +0000 (15:11 +0200)]
change lxc-unshare options
replace the specific clone options by a -s option
with the Ored list of namespaces to be cloned.
take the opportunity of this change to have
the -u <uid> option to not automatically set
the clone flag to CLONE_NEWUSER but to be dependant
of the new -s USER option.
Signed-off-by: Michel Normand <normand@fr.ibm.com> Signed-off-by: Daniel Lezcano <dlezcano@fr.ibm.com>
Daniel Lezcano [Wed, 29 Apr 2009 15:49:04 +0000 (17:49 +0200)]
define a handler to manage a container
Define a handler to store the resource informations for the container.
That allows to factor out some code and will help to encapsulate a
little more the 'start' code which is too big.
Signed-off-by: Daniel Lezcano <dlezcano@fr.ibm.com>
Daniel Lezcano [Sun, 26 Apr 2009 09:43:41 +0000 (11:43 +0200)]
add aclocal include in makefile
When auto-regen is done at the make time, eg. when the configure.in
script has been modified, the configure is not correctly generated
because the 'config' directory is missing for aclocal, and that makes
the generation to fail due to the missing macros defined in config
directory.
Signed-off-by: Daniel Lezcano <dlezcano@fr.ibm.com>
Michel Normand [Mon, 20 Apr 2009 20:10:59 +0000 (22:10 +0200)]
make the libtoolize files to be copy not
This is required to be able to make the build
on a machine that mount lxc source but not all
machine filesystem.
. Signed-off-by: Michel Normand <normand@fr.ibm.com> Signed-off-by: Daniel Lezcano <dlezcano@fr.ibm.com>
This patch adds support for various mount options. It is also able to pass extra
mount option data to mount(2). For example, it allows users to mount aufs file
system at lxc_start time.
See the thread
http://sourceforge.net/mailarchive/forum.php?thread_name=E6D98D6C-F633-419A-9424-F24EBB3E11D9%40aist.go.jp&forum_name=lxc-devel
for details.
Signed-off-by: Ryousei Takano <takano-ryousei@aist.go.jp> Signed-off-by: Daniel Lezcano <dlezcano@fr.ibm.com>
Daniel Lezcano [Tue, 31 Mar 2009 11:55:44 +0000 (13:55 +0200)]
speed container creation/destruction
As the state of the container is monitored with the netlink,
the file state is no longer used to watch the state changes.
The previous hack, which adds a tempo of 200ms, is removed and
that makes the container being created, started, stopped, destroyed
faster, we gain 1 second in a container lifecycle. One second is
too much if we launch thousand of containers, one by one like for
example in a tests suite.
Signed-off-by: Daniel Lezcano <dlezcano@fr.ibm.com>
Guido Trotter [Mon, 30 Mar 2009 09:12:13 +0000 (10:12 +0100)]
$(localstatedir) != $(prefix)/var
The current code assumes that localstatedir is equal to $(prefix)/var,
thus failing for example on debian, where prefix is /usr and
localstatedir is /var. This patch fixes this by expanding LXCPATH just
once in configure.ac to $(localstatedir)/lib/lxc and expanding that
variable everywhere else.
install-exec-local is changed to just do one mkdir -p, and taking into
account of the DESTDIR variable, user for example for packaging.
Changing the permission of LXCPATH is done in lxc-setcap
Signed-off-by: Guido Trotter <ultrotter@quaqua.net> Signed-off-by: Daniel Lezcano <dlezcano@fr.ibm.com>
I found a problem of the MTU size of br0. In the current code,
device_set_mtu() is
called after bridge_attach(), so the MTU size of br0 is set to the
default MTU size
of veth0 (i.e., 1500 bytes).
This causes performance degradation as I reported.
We need to modify to call device_set_mtu() before bridge_attach()"
Now that we have the network functions accessible, do not longer
use the lxc_configure_veth, lxc_configure_macvlan and split
the configuration of the veth in order to create it, configure it
and finally attach it to the bridge.
Daniel Lezcano [Thu, 26 Mar 2009 10:32:22 +0000 (11:32 +0100)]
change the api to export the network functions
The network functions are too encapsulated and do not allow
flexibility. Export all these api and prepare the changes for the
next patch to set the mtu.
Signed-off-by: Daniel Lezcano <dlezcano@fr.ibm.com> Acked-by: Ryousei Takano <takano-ryousei@aist.go.jp>