Commit Graph

1578 Commits

Author SHA1 Message Date
Daniel Lezcano
dbbf8b4ecb remove pkg-config dependency from lxc
Stupid me, we don't want to add a dependency to an external
tool as the library has to be standalone.

Just let lxc to define a .pc file, so the upper layer will
find the needed informations to use it.

Signed-off-by: Daniel Lezcano <dlezcano@fr.ibm.com>
2009-06-10 19:04:41 +02:00
Daniel Lezcano
287745ca25 remove lxc-config file
Remove this file as it is not used.

Signed-off-by: Daniel Lezcano <dlezcano@fr.ibm.com>
2009-06-10 19:04:41 +02:00
Daniel Lezcano
bcd952a11e rename lxc-config to lxc-version
Rename lxc-config to lxc-version in order to avoid the confusion
with what looks like a container configuration tool.

Signed-off-by: Daniel Lezcano <dlezcano@fr.ibm.com>
2009-06-10 18:49:16 +02:00
Daniel Lezcano
3eae9733be replace lxc-version by lxc-config
As we have the correct informations with pkg-config we can
write a script which will collect the informations and we get
rid of the C program.

Signed-off-by: Daniel Lezcano <dlezcano@fr.ibm.com>
2009-06-10 18:21:48 +02:00
Daniel Lezcano
b6345ba1b3 add pkg-config for lxc
Add the pkg-config information for lxc.

Signed-off-by: Daniel Lezcano <dlezcano@fr.ibm.com>
2009-06-10 18:21:48 +02:00
Daniel Lezcano
3b9246c4aa don't remove the autoconf generated files
Don't clean up the sgml which are generated by configure, otherwise
at the next make, the documentation generation will complain about
missing files.

Signed-off-by: Daniel Lezcano <dlezcano@fr.ibm.com>
2009-06-07 21:48:46 +02:00
Daniel Lezcano
b8f57738b4 log the container console when it is daemonized and the log is enabled
When we daemonize the container and we specify the log file,
the container will use the log file to write the console output.

Signed-off-by: Daniel Lezcano <dlezcano@fr.ibm.com>
2009-06-07 21:48:46 +02:00
Daniel Lezcano
c36583c303 Make possible to daemonize lxc-start
If needed the container can be launched in background
with a specific option -d.

That will make mute the container, the logs can help
to check what went wrong.

Signed-off-by: Daniel Lezcano <dlezcano@fr.ibm.com>
2009-06-07 21:48:46 +02:00
Daniel Lezcano
f8e09a0b76 save/restore the tty
Save the tty configuration before calling lxc_start and
restore it right after it has been changed.

Signed-off-by: Daniel Lezcano <dlezcano@fr.ibm.com>
2009-06-07 21:48:46 +02:00
Filippo Giunchedi
d4fca29f01 Ignore test/ binaries
Hi,
as per subject, this ignores binaries generated in test/

Signed-off-by: Daniel Lezcano <dlezcano@fr.ibm.com>
2009-06-07 21:48:46 +02:00
Filippo Giunchedi
7e610d7f1d test/: update API usage
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>
2009-06-07 21:48:45 +02:00
Daniel Lezcano
1490112767 Add missing file to the repository
Signed-off-by: Daniel Lezcano <dlezcano@fr.ibm.com>
2009-05-29 14:43:39 +02:00
Michel Normand
10fba81b9d change man pages to use a common file for common options
the common options of lxc commands
are now described in one file "common_options.sgml.in"

Signed-off-by: Michel Normand <normand@fr.ibm.com>
Signed-off-by: Daniel Lezcano <dlezcano@fr.ibm.com>
2009-05-28 15:32:30 +02:00
Michel Normand
99e4008cad change man pages to use a seealso file for references
the common references to lxc man pages
are now placed in one file "see_also.sgml.in"

Note that the few man pages that refer to man
pages that are not lxc ones have two "See Also" paragraph.

Signed-off-by: Michel Normand <normand@fr.ibm.com>
Signed-off-by: Daniel Lezcano <dlezcano@fr.ibm.com>
2009-05-28 15:32:29 +02:00
Michel Normand
439358bfe4 avoid two times error msg about invalid state
remove an error message in lxc_wait.c that duplicate
an already existing error message in state.c

Signed-off-by: Michel Normand <normand@fr.ibm.com>
Signed-off-by: Daniel Lezcano <dlezcano@fr.ibm.com>
2009-05-28 15:32:29 +02:00
Michel Normand
549153a7cf lxc-wait to check if container already in requested state
Without this patch the lxc_wait may wait forever
if container is already in requested state.

Note that this patch avoids also to be hang if container do not exist yet.

Signed-off-by: Michel Normand <normand@fr.ibm.com>
Signed-off-by: Daniel Lezcano <dlezcano@fr.ibm.com>
2009-05-28 15:32:29 +02:00
Michel Normand
2c396e124b add an error message if more than one monitor
the change introduced by commit 31c53c2e1a
do not allow anymore to have more than one monitor.

The purpose of this patch is to add an error message
when such a condition is identified, eg:
===
lxc-monitor: bind : Address already in use
===

Signed-off-by: Michel Normand <normand@fr.ibm.com>
Signed-off-by: Daniel Lezcano <dlezcano@fr.ibm.com>
2009-05-28 15:32:29 +02:00
Daniel Lezcano
018ef5201b choose a default network interface name
When no name is specified in the configuration file for an interface,
let the system to choose one nice name like "eth".

Signed-off-by: Daniel Lezcano <dlezcano@fr.ibm.com>
2009-05-28 12:10:51 +02:00
Daniel Lezcano
f8af8e239e Fix lxc-netstat
The lxc-unshare cli has changed, fix the call to lxc-unshare
in lxc-netstat.

Signed-off-by: Daniel Lezcano <dlezcano@fr.ibm.com>
2009-05-28 12:10:51 +02:00
Daniel Lezcano
3f8b55d5cc save the config file in the statefile directory
Save the configuration file in the statefile directory so it
can be re-created at restart time.

Signed-off-by: Daniel Lezcano <dlezcano@fr.ibm.com>
2009-05-28 12:10:50 +02:00
Daniel Lezcano
6b201d02b0 add a statefile directory parameter
add a statefile directory parameter in order to save some
lxc informations a checkpoint.

Signed-off-by: Daniel Lezcano <dlezcano@fr.ibm.com>
2009-05-28 12:10:50 +02:00
Daniel Lezcano
d7efa8fcbf copy the configuration file in the conf repo
When creating the container, copy the configuration file to the
configuration tree.

Signed-off-by: Daniel Lezcano <dlezcano@fr.ibm.com>
2009-05-28 12:10:50 +02:00
Daniel Lezcano
4fcc0112bd create the container with an empty configuration
Fix the code to not fail when the specified configuration file
is empty.

Signed-off-by: Daniel Lezcano <dlezcano@fr.ibm.com>
2009-05-28 12:10:50 +02:00
Daniel Lezcano
6203de18eb 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>
2009-05-28 12:10:50 +02:00
Daniel Lezcano
920dfa346c 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>
2009-05-28 12:10:50 +02:00
Daniel Lezcano
34c66a6980 Remove old code to destroy the network
Removed this unused code.

Signed-off-by: Daniel Lezcano <dlezcano@fr.ibm.com>
2009-05-28 12:10:50 +02:00
Daniel Lezcano
3f739da8b5 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>
2009-05-28 12:10:50 +02:00
Daniel Lezcano
64e1ae63eb make use of the copy file function
Now we have specific function to copy the files, make use of it
and remove the old code.

Signed-off-by: Daniel Lezcano <dlezcano@fr.ibm.com>
2009-05-28 12:10:50 +02:00
Daniel Lezcano
e3642c43e6 make a "copy file" function
Create a specific function to copy a file from a location to
another location.

Signed-off-by: Daniel Lezcano <dlezcano@fr.ibm.com>
2009-05-28 12:10:50 +02:00
Michel Normand
7cee878951 remove lxc_error_t enum that is now useless
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>
2009-05-18 22:30:39 +02:00
Michel Normand
95b5ffafae remove LXC_ERROR_* usage in src/lxc/conf.c as not required
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>
2009-05-18 22:30:39 +02:00
Michel Normand
75b1e1981d lxc-monitor and lxc-wait to return 255 in case of error
to have same exit code for all lxc commands

Signed-off-by: Michel Normand <normand@fr.ibm.com>
Signed-off-by: Daniel Lezcano <dlezcano@fr.ibm.com>
2009-05-18 22:27:36 +02:00
Michel Normand
272bc5af96 lxc-cgroup to return 255 in case of error
to have same exit code for all lxc commands

Signed-off-by: Michel Normand <normand@fr.ibm.com>
Signed-off-by: Daniel Lezcano <dlezcano@fr.ibm.com>
2009-05-18 22:27:36 +02:00
Michel Normand
2ea004b8c6 lxc-console to return 255 in case of error
to have same exit code for all lxc commands

Signed-off-by: Michel Normand <normand@fr.ibm.com>
Signed-off-by: Daniel Lezcano <dlezcano@fr.ibm.com>
2009-05-18 22:27:36 +02:00
Michel Normand
a30284df84 lxc-checkpoint ad lxc-restart to return 255 in case of error
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>
2009-05-18 22:27:36 +02:00
Michel Normand
c8f55b0eff lxc-freeze and lxc-unfreeze to return 255 in case of error
to have same exit code for all lxc commands

Signed-off-by: Michel Normand <normand@fr.ibm.com>
Signed-off-by: Daniel Lezcano <dlezcano@fr.ibm.com>
2009-05-18 22:27:36 +02:00
Michel Normand
f4072342e0 correct error reporting for lxc_setstate
there was a missing init of local variable

Signed-off-by: Daniel Lezcano <dlezcano@fr.ibm.com>
Signed-off-by: Michel Normand <normand@fr.ibm.com>
2009-05-18 22:27:35 +02:00
Michel Normand
79507e493e lxc-destroy return 255 in case of error
to have same exit code for all lxc commands

Signed-off-by: Michel Normand <normand@fr.ibm.com>
Signed-off-by: Daniel Lezcano <dlezcano@fr.ibm.com>
2009-05-18 22:27:35 +02:00
Michel Normand
7f8306138a lxc-create to return 255 in case of error
to have same exit code for all lxc commands

Signed-off-by: Michel Normand <normand@fr.ibm.com>
Signed-off-by: Daniel Lezcano <dlezcano@fr.ibm.com>
2009-05-18 22:27:35 +02:00
Michel Normand
23075e69dc lxc-stop to return 255 in case of error
to have same exit code for all lxc commands

Signed-off-by: Michel Normand <normand@fr.ibm.com>
Signed-off-by: Daniel Lezcano <dlezcano@fr.ibm.com>
2009-05-18 22:27:35 +02:00
Michel Normand
b0ed5e6423 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>
2009-05-18 22:27:35 +02:00
Michel Normand
8559e7039c add support of lxc log file to lxc-init
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>
2009-05-18 22:27:35 +02:00
Michel Normand
e043236e2a 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>
2009-05-18 22:27:34 +02:00
Michel Normand
41cfbac9dd add long options step4
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>
2009-05-18 22:11:46 +02:00
Michel Normand
4237c6ca1f add long options step3
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>
2009-05-18 22:11:46 +02:00
Michel Normand
9618063c87 add long options step2
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>
2009-05-18 22:11:45 +02:00
Michel Normand
cda02a28c0 add long options step1
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>
2009-05-18 22:11:45 +02:00
Michel Normand
441e496395 add quiet option
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>
2009-05-18 22:11:45 +02:00
Michel Normand
fcffb59fc8 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>
2009-05-18 22:11:45 +02:00
Michel Normand
4c200d12e0 report error in lxc_get_lock
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>
2009-05-17 13:43:51 +02:00