]> git.proxmox.com Git - mirror_lxc.git/log
mirror_lxc.git
14 years agoadd pkg-config for lxc
Daniel Lezcano [Wed, 10 Jun 2009 16:21:48 +0000 (18:21 +0200)]
add pkg-config for lxc

Add the pkg-config information for lxc.

Signed-off-by: Daniel Lezcano <dlezcano@fr.ibm.com>
14 years agodon't remove the autoconf generated files
Daniel Lezcano [Sun, 7 Jun 2009 19:48:46 +0000 (21:48 +0200)]
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>
14 years agolog the container console when it is daemonized and the log is enabled
Daniel Lezcano [Sun, 7 Jun 2009 19:48:46 +0000 (21:48 +0200)]
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>
14 years agoMake possible to daemonize lxc-start
Daniel Lezcano [Sun, 7 Jun 2009 19:48:46 +0000 (21:48 +0200)]
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>
14 years agosave/restore the tty
Daniel Lezcano [Sun, 7 Jun 2009 19:48:46 +0000 (21:48 +0200)]
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>
14 years agoIgnore test/ binaries
Filippo Giunchedi [Sun, 7 Jun 2009 19:48:46 +0000 (21:48 +0200)]
Ignore test/ binaries

Hi,
as per subject, this ignores binaries generated in test/

Signed-off-by: Daniel Lezcano <dlezcano@fr.ibm.com>
14 years agotest/: update API usage
Filippo Giunchedi [Sun, 7 Jun 2009 19:48:45 +0000 (21:48 +0200)]
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>
15 years agoAdd missing file to the repository
Daniel Lezcano [Fri, 29 May 2009 12:43:39 +0000 (14:43 +0200)]
Add missing file to the repository

Signed-off-by: Daniel Lezcano <dlezcano@fr.ibm.com>
15 years agochange man pages to use a common file for common options
Michel Normand [Thu, 28 May 2009 13:32:30 +0000 (15:32 +0200)]
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>
15 years agochange man pages to use a seealso file for references
Michel Normand [Thu, 28 May 2009 13:32:29 +0000 (15:32 +0200)]
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>
15 years agoavoid two times error msg about invalid state
Michel Normand [Thu, 28 May 2009 13:32:29 +0000 (15:32 +0200)]
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>
15 years agolxc-wait to check if container already in requested state
Michel Normand [Thu, 28 May 2009 13:32:29 +0000 (15:32 +0200)]
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>
15 years agoadd an error message if more than one monitor
Michel Normand [Thu, 28 May 2009 13:32:29 +0000 (15:32 +0200)]
add an error message if more than one monitor

the change introduced by commit 31c53c2e1afc6c81ce4aad5ef4cb982cd2fea365
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>
15 years agochoose a default network interface name
Daniel Lezcano [Thu, 28 May 2009 10:10:51 +0000 (12:10 +0200)]
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>
15 years agoFix lxc-netstat
Daniel Lezcano [Thu, 28 May 2009 10:10:51 +0000 (12:10 +0200)]
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>
15 years agosave the config file in the statefile directory
Daniel Lezcano [Thu, 28 May 2009 10:10:50 +0000 (12:10 +0200)]
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>
15 years agoadd a statefile directory parameter
Daniel Lezcano [Thu, 28 May 2009 10:10:50 +0000 (12:10 +0200)]
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>
15 years agocopy the configuration file in the conf repo
Daniel Lezcano [Thu, 28 May 2009 10:10:50 +0000 (12:10 +0200)]
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>
15 years agocreate the container with an empty configuration
Daniel Lezcano [Thu, 28 May 2009 10:10:50 +0000 (12:10 +0200)]
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>
15 years agorename the ns_cgroup with the container name
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>
15 years agochange the checkpoint/restart function api
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>
15 years agoRemove old code to destroy the network
Daniel Lezcano [Thu, 28 May 2009 10:10:50 +0000 (12:10 +0200)]
Remove old code to destroy the network

Removed this unused code.

Signed-off-by: Daniel Lezcano <dlezcano@fr.ibm.com>
15 years agoremove checkpoint / restart code
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>
15 years agomake use of the copy file function
Daniel Lezcano [Thu, 28 May 2009 10:10:50 +0000 (12:10 +0200)]
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>
15 years agomake a "copy file" function
Daniel Lezcano [Thu, 28 May 2009 10:10:50 +0000 (12:10 +0200)]
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>
15 years agoremove lxc_error_t enum that is now useless
Michel Normand [Mon, 18 May 2009 20:30:39 +0000 (22:30 +0200)]
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>
15 years agoremove LXC_ERROR_* usage in src/lxc/conf.c as not required
Michel Normand [Mon, 18 May 2009 20:30:39 +0000 (22:30 +0200)]
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>
15 years agolxc-monitor and lxc-wait to return 255 in case of error
Michel Normand [Mon, 18 May 2009 20:27:36 +0000 (22:27 +0200)]
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>
15 years agolxc-cgroup to return 255 in case of error
Michel Normand [Mon, 18 May 2009 20:27:36 +0000 (22:27 +0200)]
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>
15 years agolxc-console to return 255 in case of error
Michel Normand [Mon, 18 May 2009 20:27:36 +0000 (22:27 +0200)]
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>
15 years agolxc-checkpoint ad lxc-restart to return 255 in case of error
Michel Normand [Mon, 18 May 2009 20:27:36 +0000 (22:27 +0200)]
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>
15 years agolxc-freeze and lxc-unfreeze to return 255 in case of error
Michel Normand [Mon, 18 May 2009 20:27:36 +0000 (22:27 +0200)]
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>
15 years agocorrect error reporting for lxc_setstate
Michel Normand [Mon, 18 May 2009 20:27:35 +0000 (22:27 +0200)]
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>
15 years agolxc-destroy return 255 in case of error
Michel Normand [Mon, 18 May 2009 20:27:35 +0000 (22:27 +0200)]
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>
15 years agolxc-create to return 255 in case of error
Michel Normand [Mon, 18 May 2009 20:27:35 +0000 (22:27 +0200)]
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>
15 years agolxc-stop to return 255 in case of error
Michel Normand [Mon, 18 May 2009 20:27:35 +0000 (22:27 +0200)]
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>
15 years agolxc-execute to report exit code of started application
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>
15 years agoadd support of lxc log file to lxc-init
Michel Normand [Mon, 18 May 2009 20:27:35 +0000 (22:27 +0200)]
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>
15 years agolxc-start to report exit code of started application
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>
15 years agoadd long options step4
Michel Normand [Mon, 18 May 2009 20:11:46 +0000 (22:11 +0200)]
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>
15 years agoadd long options step3
Michel Normand [Mon, 18 May 2009 20:11:46 +0000 (22:11 +0200)]
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>
15 years agoadd long options step2
Michel Normand [Mon, 18 May 2009 20:11:45 +0000 (22:11 +0200)]
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>
15 years agoadd long options step1
Michel Normand [Mon, 18 May 2009 20:11:45 +0000 (22:11 +0200)]
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>
15 years agoadd quiet option
Michel Normand [Mon, 18 May 2009 20:11:45 +0000 (22:11 +0200)]
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>
15 years agoin lxc-unshare remove log options
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>
15 years agoreport error in lxc_get_lock
Michel Normand [Sun, 17 May 2009 11:43:51 +0000 (13:43 +0200)]
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>
15 years agocreate a new lxc_check_lock function
Michel Normand [Sun, 17 May 2009 11:43:51 +0000 (13:43 +0200)]
create a new lxc_check_lock function

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>
15 years agoadd a default stderror log appender
Michel Normand [Fri, 15 May 2009 08:47:08 +0000 (10:47 +0200)]
add a default stderror log appender

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>
15 years agoproperly handle va_list in log_append functions
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>
15 years agoReplace netlink by abstract unix socket
Daniel Lezcano [Thu, 14 May 2009 19:28:27 +0000 (21:28 +0200)]
Replace netlink by abstract unix socket

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>
15 years agochange lxc_cgroup_set/get functions to return -1
Michel Normand [Thu, 14 May 2009 14:27:29 +0000 (16:27 +0200)]
change lxc_cgroup_set/get functions to return -1

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>
15 years agoSYSERROR not to add end of line character
Michel Normand [Thu, 14 May 2009 14:27:28 +0000 (16:27 +0200)]
SYSERROR not to add end of line character

I assume this is a typo error.

Signed-off-by: Daniel Lezcano <dlezcano@fr.ibm.com>
Signed-off-by: Michel Normand <normand@fr.ibm.com>
15 years agoadd support of a lxc log file to cli
Michel Normand [Thu, 14 May 2009 13:52:03 +0000 (15:52 +0200)]
add support of a lxc log file to cli

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>
15 years agoremove fprintf to stderr and replace by ERROR call when needed
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>
15 years agoadd error log in lxc_file_for_each_line
Michel Normand [Thu, 14 May 2009 13:23:30 +0000 (15:23 +0200)]
add error log in lxc_file_for_each_line

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>
15 years agochange lxc-cgroup parameter checking
Michel Normand [Thu, 14 May 2009 13:23:30 +0000 (15:23 +0200)]
change lxc-cgroup parameter checking

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>
15 years agochange lxc-unshare options
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>
15 years agoreplace fprintf by ERROR call in lxc_unshare.c
Michel Normand [Thu, 14 May 2009 13:11:40 +0000 (15:11 +0200)]
replace fprintf by ERROR call in lxc_unshare.c

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>
15 years agoavoid segfault on git-unshare
Michel Normand [Thu, 14 May 2009 13:11:39 +0000 (15:11 +0200)]
avoid segfault on git-unshare

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>
15 years agoautoassign tty number
Daniel Lezcano [Thu, 7 May 2009 17:36:33 +0000 (19:36 +0200)]
autoassign tty number

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>
15 years agoexport-fine-grain-api-for-start
Daniel Lezcano [Wed, 29 Apr 2009 15:49:04 +0000 (17:49 +0200)]
export-fine-grain-api-for-start

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>
15 years agoencapsulate the lxc code
Daniel Lezcano [Wed, 29 Apr 2009 15:49:04 +0000 (17:49 +0200)]
encapsulate the lxc code

Make the lxc code more modular and use it for lxc_start
function.

Signed-off-by: Daniel Lezcano <dlezcano@fr.ibm.com>
15 years agodefine a handler to manage a container
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>
15 years agoRevert "make the log fd thread safe"
Daniel Lezcano [Sun, 26 Apr 2009 09:49:53 +0000 (11:49 +0200)]
Revert "make the log fd thread safe"

This reverts commit 2c9bd0073f29573181dc16a840c674dacc8a33fd.

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.

15 years agorename configure.in to configure.ac
Daniel Lezcano [Sun, 26 Apr 2009 09:43:41 +0000 (11:43 +0200)]
rename configure.in to configure.ac

Rename configure.in to configure.ac as it is the correct
name for the recent version.

Signed-off-by: Daniel Lezcano <dlezcano@fr.ibm.com>
15 years agoremove m4 dir usage
Daniel Lezcano [Sun, 26 Apr 2009 09:43:41 +0000 (11:43 +0200)]
remove m4 dir usage

As the m4 directory is not used, remove the usage from
the scripts.

Signed-off-by: Daniel Lezcano <dlezcano@fr.ibm.com>
15 years agoadd aclocal include in makefile
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>
15 years agoinc the minor version
Daniel Lezcano [Fri, 24 Apr 2009 09:41:08 +0000 (11:41 +0200)]
inc the minor version

Inc the minor version for the next release.

Signed-off-by: Daniel Lezcano <dlezcano@fr.ibm.com>
15 years agoSetting execution permission for the file
Daniel Lezcano [Fri, 24 Apr 2009 09:38:47 +0000 (11:38 +0200)]
Setting execution permission for the file

Signed-off-by: Daniel Lezcano <dlezcano@fr.ibm.com>
15 years agoswap doc compilation order
Daniel Lezcano [Fri, 24 Apr 2009 09:32:58 +0000 (11:32 +0200)]
swap doc compilation order

Let's compile the documentation when everything has compiled
well, that saves time for devel ;)

Signed-off-by: Daniel Lezcano <dlezcano@fr.ibm.com>
15 years agoadd the autogen script in the dist tarball
Daniel Lezcano [Fri, 24 Apr 2009 09:32:58 +0000 (11:32 +0200)]
add the autogen script in the dist tarball

Add the autogen script to the tarball so people using the
dist version can patch the auto* files and regenerate them
directly for the dist tarball.

Signed-off-by: Daniel Lezcano <dlezcano@fr.ibm.com>
Reported-by: Michael K Johnson <johnsonm@rpath.com>
15 years agorename bootstrap to autogen.sh
Daniel Lezcano [Fri, 24 Apr 2009 09:32:58 +0000 (11:32 +0200)]
rename bootstrap to autogen.sh

By convention the script calling the auto tools is named
autogen.sh. I rename 'bootstrap' to 'autogen.sh' in order to
stick to this convention.

Signed-off-by: Daniel Lezcano <dlezcano@fr.ibm.com>
Reported-by: Michael K Johnson <johnsonm@rpath.com>
15 years agoadd the missing header in the log file
Daniel Lezcano [Fri, 24 Apr 2009 09:32:58 +0000 (11:32 +0200)]
add the missing header in the log file

License header is missing in the log files.

Signed-off-by: Daniel Lezcano <dlezcano@fr.ibm.com>
15 years agolocally define O_CLOEXEC
Michel Normand [Fri, 24 Apr 2009 09:32:58 +0000 (11:32 +0200)]
locally define O_CLOEXEC

this is a required patch to be able to compile lxc on a RedHat 5 update 1
which has such define.
This is also required for the F_DUPFD_CLOEXEC define

Signed-off-by: Michel Normand <normand@fr.ibm.com>
Signed-off-by: Daniel Lezcano <dlezcano@fr.ibm.com>
15 years agomake the log fd thread safe
Daniel Lezcano [Tue, 21 Apr 2009 19:51:13 +0000 (21:51 +0200)]
make the log fd thread safe

Add the tls attribute for the global static variables in the logs.

Signed-off-by: Daniel Lezcano <dlezcano@fr.ibm.com>
15 years agolxc: cleanup log
Cedric Le Goater [Tue, 21 Apr 2009 19:51:13 +0000 (21:51 +0200)]
lxc: cleanup log

some headers and macros are now redundant

Signed-off-by: Cedric Le Goater <legoater@free.fr>
Acked-by: Daniel Lezcano <dlezcano@fr.ibm.com>
Signed-off-by: Daniel Lezcano <dlezcano@fr.ibm.com>
15 years agolxc: use new logging system
Cedric Le Goater [Tue, 21 Apr 2009 19:51:13 +0000 (21:51 +0200)]
lxc: use new logging system

This patch defines a new log category in each file using logging and
replaced the former logging routines with the new ones.

Signed-off-by: Cedric Le Goater <legoater@free.fr>
Acked-by: Daniel Lezcano <dlezcano@fr.ibm.com>
Signed-off-by: Daniel Lezcano <dlezcano@fr.ibm.com>
15 years agolxc: introduce log4c style logging
Cedric Le Goater [Tue, 21 Apr 2009 19:51:13 +0000 (21:51 +0200)]
lxc: introduce log4c style logging

lxc_log_init() should be called in each main() of a command
to define the default log priority and log file.

Signed-off-by: Cedric Le Goater <legoater@free.fr>
Acked-by: Daniel Lezcano <dlezcano@fr.ibm.com>
Signed-off-by: Daniel Lezcano <dlezcano@fr.ibm.com>
15 years agoexclude generated tarball from git managed files
Michel Normand [Mon, 20 Apr 2009 20:10:59 +0000 (22:10 +0200)]
exclude generated tarball from git managed files

exclude generated tarball from git managed files

Signed-off-by: Michel Normand <normand@fr.ibm.com>
Signed-off-by: Daniel Lezcano <dlezcano@fr.ibm.com>
15 years agomake the libtoolize files to be copy not
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>
15 years agoAdd support for various mount options
Ryousei Takano [Mon, 20 Apr 2009 20:10:59 +0000 (22:10 +0200)]
Add support for various mount options

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>
15 years agoprevent tty fd to be inherited in the container
Môshe van der Sterre [Mon, 20 Apr 2009 20:10:59 +0000 (22:10 +0200)]
prevent tty fd to be inherited in the container

Set the close on exec flag on the pty fd so they are automatically
closed when execing the container.

Signed-off-by: Môshe van der Sterre <me@moshe.nl>
Signed-off-by: Daniel Lezcano <dlezcano@fr.ibm.com>
15 years agocheck multiple devpts instance
Môshe van der Sterre [Mon, 20 Apr 2009 20:10:59 +0000 (22:10 +0200)]
check multiple devpts instance

Hello,

It took me some thinking to figure out DEVPTS_MULTIPLE_INSTANCES was disabled.
Maybe checking for it in lxc-checkconfig will be helpfull to others.

Greetings,
Môshe van der Sterre

Signed-off-by: Môshe van der Sterre <moshevds@gmail.com>
Signed-off-by: Daniel Lezcano <dlezcano@fr.ibm.com>
15 years agodon't remove init file in the stop function
Daniel Lezcano [Tue, 31 Mar 2009 11:55:44 +0000 (13:55 +0200)]
don't remove init file in the stop function

At present the 'init' file is deleted from the 'stop' function and
I don't remember why it is done in this place :)

The 'init' file is removed from the 'start' when the first process
has been deleted.

Signed-off-by: Daniel Lezcano <dlezcano@fr.ibm.com>
15 years agospeed container creation/destruction
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>
15 years agoFix compile warnings
Ryousei Takano [Tue, 31 Mar 2009 01:14:04 +0000 (10:14 +0900)]
Fix compile warnings

This patch fixes compile warnings: ignoring return value of function,
declared with attribute warn_unused_result, and adds error handling.

Signed-off-by: Ryousei Takano <takano-ryousei@aist.go.jp>
Signed-off-by: Daniel Lezcano <dlezcano@fr.ibm.com>
15 years ago$(localstatedir) != $(prefix)/var
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>
15 years agoadd error.h header
Daniel Lezcano [Mon, 30 Mar 2009 12:02:19 +0000 (14:02 +0200)]
add error.h header

Add the missing header in the package installation.

Signed-off-by: Daniel Lezcano <dlezcano@fr.ibm.com>
15 years agomove lxc_conf_init to conf.c
Daniel Lezcano [Mon, 30 Mar 2009 12:02:19 +0000 (14:02 +0200)]
move lxc_conf_init to conf.c

Changed the struct lxc_conf initialization function to the
right place.

Signed-off-by: Daniel Lezcano <daniel.lezcano@free.fr>
15 years agocleanup config.h
Daniel Lezcano [Mon, 30 Mar 2009 12:02:19 +0000 (14:02 +0200)]
cleanup config.h

Rename lxc_config.h to confile.h

Signed-off-by: Daniel Lezcano <daniel.lezcano@free.fr>
15 years agocleanup state.h
Daniel Lezcano [Mon, 30 Mar 2009 12:02:19 +0000 (14:02 +0200)]
cleanup state.h

Rename lxc_state.h to state.h

Signed-off-by: Daniel Lezcano <daniel.lezcano@free.fr>
15 years agocleanup list.h
Daniel Lezcano [Mon, 30 Mar 2009 12:02:19 +0000 (14:02 +0200)]
cleanup list.h

Rename lxc_list.h to list.h

Signed-off-by: Daniel Lezcano <daniel.lezcano@free.fr>
15 years agocleanup log.h
Daniel Lezcano [Mon, 30 Mar 2009 12:02:19 +0000 (14:02 +0200)]
cleanup log.h

Rename lxc_log.h to log.h

Signed-off-by: Daniel Lezcano <daniel.lezcano@free.fr>
15 years agocleanup conf.h
Daniel Lezcano [Mon, 30 Mar 2009 12:02:19 +0000 (14:02 +0200)]
cleanup conf.h

Rename lxc_conf.h to conf.h

Signed-off-by: Daniel Lezcano <daniel.lezcano@free.fr>
15 years agocleanup cgroup.h
Daniel Lezcano [Mon, 30 Mar 2009 12:02:19 +0000 (14:02 +0200)]
cleanup cgroup.h

Rename lxc_cgroup.h to cgroup.h

Signed-off-by: Daniel Lezcano <daniel.lezcano@free.fr>
15 years agocleanup lock.h
Daniel Lezcano [Mon, 30 Mar 2009 12:02:19 +0000 (14:02 +0200)]
cleanup lock.h

Rename lxc_lock.h to lock.h

Signed-off-by: Daniel Lezcano <daniel.lezcano@free.fr>
15 years agocleanup namespace.h
Daniel Lezcano [Mon, 30 Mar 2009 12:02:19 +0000 (14:02 +0200)]
cleanup namespace.h

Rename lxc_namespace.h to namespace.h

Signed-off-by: Daniel Lezcano <daniel.lezcano@free.fr>
15 years agoUse 'uname -m' instead of arch
Ryousei Takano [Fri, 27 Mar 2009 04:50:34 +0000 (13:50 +0900)]
Use 'uname -m' instead of arch

'uname -m' seems to be more general to get the machine's architecture
type.  Ubunbu 8.10 (and also all debian based distros?) does not have
arch(1).

Signed-off-by: Ryousei Takano <takano-ryousei@aist.go.jp>
Signed-off-by: Daniel Lezcano <dlezcano@fr.ibm.com>
15 years agoAdd mtu option setting for lxc-fedora
Ryousei Takano [Thu, 26 Mar 2009 10:21:44 +0000 (19:21 +0900)]
Add mtu option setting for lxc-fedora

This patch adds the mtu option setting for the lxc-fedora script.

Signed-off-by: Ryousei Takano <takano-ryousei@aist.go.jp>
Signed-off-by: Daniel Lezcano <dlezcano@fr.ibm.com>
15 years agoAdd mtu option setting for lxc-debian
Ryousei Takano [Thu, 26 Mar 2009 10:21:42 +0000 (19:21 +0900)]
Add mtu option setting for lxc-debian

This patch adds the mtu option setting for the lxc-debian script.

Signed-off-by: Ryousei Takano <takano-ryousei@aist.go.jp>
Signed-off-by: Daniel Lezcano <dlezcano@fr.ibm.com>