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>
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>
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>
There is no more need of the LXC_ERROR defines
and related lxc_strerror function.
Signed-off-by: Michel Normand <normand@fr.ibm.com>
Signed-off-by: Daniel Lezcano <dlezcano@fr.ibm.com>
This is useless because error is already reported by the functions
Signed-off-by: Michel Normand <normand@fr.ibm.com>
Signed-off-by: Daniel Lezcano <dlezcano@fr.ibm.com>
to have same exit code for all lxc commands
Note that the lxc-restart is not yet reporting
the error of restarted application as done with lxc-start.
Signed-off-by: Michel Normand <normand@fr.ibm.com>
Signed-off-by: Daniel Lezcano <dlezcano@fr.ibm.com>
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>
pass to lxc-init the log options given to lxc-execute
(in fact logfile logpriority and quiet)
Signed-off-by: Daniel Lezcano <dlezcano@fr.ibm.com>
Signed-off-by: Michel Normand <normand@fr.ibm.com>
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>
add the long options to the remaining lxc_*.c files
that need changes in struct lxc_arguments.
Signed-off-by: Michel Normand <normand@fr.ibm.com>
Signed-off-by: Daniel Lezcano <dlezcano@fr.ibm.com>
add the long options to remaining lxc_*.c files
that do not impact the struct lxc_arguments
Signed-off-by: Michel Normand <normand@fr.ibm.com>
Signed-off-by: Daniel Lezcano <dlezcano@fr.ibm.com>
add the long options to lxc-start
with a small change in lxc_start proto to avoid compilation warning
Signed-off-by: Michel Normand <normand@fr.ibm.com>
Signed-off-by: Daniel Lezcano <dlezcano@fr.ibm.com>
add the long options to lxc-execute as an exemple
of usage of the new functions added in src/lxc/arguments.*
Signed-off-by: Michel Normand <normand@fr.ibm.com>
Signed-off-by: Daniel Lezcano <dlezcano@fr.ibm.com>
This added quiet option allow to disable
the reporting via stderr of the lxc error messages.
Note that the usage function is still printing in case of error,
but will be removed by later patches
Signed-off-by: Michel Normand <normand@fr.ibm.com>
Signed-off-by: Daniel Lezcano <dlezcano@fr.ibm.com>
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>
report error in lxc_get_lock and remove the call to lxc_strerror
that become useless for these errors.
Signed-off-by: Michel Normand <normand@fr.ibm.com>
Signed-off-by: Daniel Lezcano <dlezcano@fr.ibm.com>
added in src/lock.c to replace call to lxc_get_lock and lxc_put_lock,
when only need to check if container is active or not.
Signed-off-by: Michel Normand <normand@fr.ibm.com>
Signed-off-by: Daniel Lezcano <dlezcano@fr.ibm.com>
This is adding a stderror log appender that is used as default one.
Signed-off-by: Michel Normand <normand@fr.ibm.com>
Signed-off-by: Daniel Lezcano <dlezcano@fr.ibm.com>
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>
Instead of messing with the netlink messages, let's
use the abstract unix socket and assume we will have
a single receiver and multiple sender.
With this patch mcr-wait and mcr-monitor are mutually
exclusive... for the moment.
Signed-off-by: Daniel Lezcano <dlezcano@fr.ibm.com>
and report error message as soon as detected error in these two functions
Signed-off-by: Daniel Lezcano <dlezcano@fr.ibm.com>
Signed-off-by: Michel Normand <normand@fr.ibm.com>
this is adding -o and -l options to all cli of lxc
Signed-off-by: Michel Normand <normand@fr.ibm.com>
Signed-off-by: Daniel Lezcano <dlezcano@fr.ibm.com>
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>
this is required to log error where needed
and to to avoid additionnal log later on.
Signed-off-by: Michel Normand <normand@fr.ibm.com>
Signed-off-by: Daniel Lezcano <dlezcano@fr.ibm.com>
required to support either:
lxc-cgroup -n foo subsystem value
lxc-cgroup -nfoo subsystem value
Signed-off-by: Michel Normand <normand@fr.ibm.com>
Signed-off-by: Daniel Lezcano <dlezcano@fr.ibm.com>
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>
Do it except for the usage functions that will be removed by another patch
This is a follow on a previous patch that treated
all src/lxc/lxc_*.c but this file.
Signed-off-by: Michel Normand <normand@fr.ibm.com>
Signed-off-by: Daniel Lezcano <dlezcano@fr.ibm.com>
avoid segfault when invalid parameter
git-unshare -u 666666
and improve error reporting
Signed-off-by: Michel Normand <normand@fr.ibm.com>
Signed-off-by: Daniel Lezcano <dlezcano@fr.ibm.com>
When no tty number is specified in the command line,
let the tty service to provide choose one available
tty and provide this one.
The documentation is updated wrt this modification and
I did a little fix to generate the date of the documentation.
Signed-off-by: Daniel Lezcano <dlezcano@fr.ibm.com>
Export the fine grain api of lxc to be usable for external
component which wants to have more control on the container.
Signed-off-by: Daniel Lezcano <dlezcano@fr.ibm.com>
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>
This reverts commit 2c9bd0073f.
Pointless and useless right now and certainly wrong as several
threads in the library may want to log to the same, to be defined
later.
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>