Commit Graph

284 Commits

Author SHA1 Message Date
Daniel Lezcano
ab2d32f88c Replace create/destroy by a script
The simplification of the container configuration makes
pointless to have so much complexity in the container creation.
Let's remove that and replace by some scripts.

Signed-off-by: Daniel Lezcano <dlezcano@fr.ibm.com>
2009-11-13 11:48:29 +01:00
Andrian Nord
7fa9074f13 ipv6 interfaces added with /0 prefix
Greetings, I've found a small typo into src/lxc/conf.c that leads to
nulled prefix for ipv6 addresses.

Signed-off-by: Andrian Nord <NightNord@gmail.com>
Signed-off-by: Daniel Lezcano <dlezcano@fr.ibm.com>
2009-11-09 10:43:03 +01:00
Daniel Lezcano
881450bbed use config.h to define the lxcpath and co
Instead of passing the LXCPATH definition in the compiler
command line, use configure.ac to define the value in the config.h
file and include this file where it is needed.

Signed-off-by: Daniel Lezcano <dlezcano@fr.ibm.com>
2009-10-22 15:33:40 +02:00
Daniel Lezcano
d685aa8049 clean up and factor out some code
Factor out some code and fix a memory corruption when
dupping the arguments.

Signed-off-by: Daniel Lezcano <dlezcano@fr.ibm.com>
2009-10-12 22:02:06 +02:00
Daniel Lezcano
a79cf70427 remove configure dead code
Remove the old configuration remaining code.

Signed-off-by: Daniel Lezcano <dlezcano@fr.ibm.com>
2009-10-12 22:02:06 +02:00
Daniel Lezcano
5e4a62bf32 fix tty creation using confdir
tty_create uses the old conf directory, fixing this.

Signed-off-by: Daniel Lezcano <dlezcano@fr.ibm.com>
2009-10-09 11:38:39 +02:00
Daniel Lezcano
5f4535a3d9 fix netdev structure vs network structure
The netdev vs network structure is not well defined. Fix that.

Signed-off-by: Daniel Lezcano <dlezcano@fr.ibm.com>
2009-10-09 11:38:39 +02:00
Daniel Lezcano
4bf1968d3c Factor out some network code
We can factor out the "ip addr add"

Signed-off-by: Daniel Lezcano <dlezcano@fr.ibm.com>
2009-10-09 11:38:39 +02:00
Daniel Lezcano
82d5ae15e7 Use the configuration structure for the network
We don't want to use anymore the configuration directory,
let's use the configuration structure.

Signed-off-by: Daniel Lezcano <dlezcano@fr.ibm.com>
2009-10-09 11:38:39 +02:00
Daniel Lezcano
571e6ec89e Move configuration info to the structure
Move configuration informations from the handler structure to
the configuration structure.

Signed-off-by: Daniel Lezcano <dlezcano@fr.ibm.com>
2009-10-09 11:38:39 +02:00
Daniel Lezcano
88d5514d16 Move the configuration file to the start function
We want to store more information in the configuration structure,
especially the ttys.

Signed-off-by: Daniel Lezcano <dlezcano@fr.ibm.com>
2009-10-09 11:38:39 +02:00
Daniel Lezcano
102a53038a use the configuration structure for the cgroup
Do not use the directory configuration

Signed-off-by: Daniel Lezcano <dlezcano@fr.ibm.com>
2009-10-09 11:38:39 +02:00
Daniel Lezcano
52e3595723 use the configuration structure for the tty
Do not use the directory configuration

Signed-off-by: Daniel Lezcano <dlezcano@fr.ibm.com>
2009-10-09 11:38:39 +02:00
Daniel Lezcano
1bc60a65c9 use configuration structure for the mount points
Do not use the directory configuration for the mount points.

Signed-off-by: Daniel Lezcano <dlezcano@fr.ibm.com>
2009-10-09 11:38:39 +02:00
Daniel Lezcano
d852c78cf0 Use the configuration structure for pts
Avoid to use the directory structure.

Signed-off-by: Daniel Lezcano <dlezcano@fr.ibm.com>
2009-10-09 11:38:38 +02:00
Daniel Lezcano
4e5440c654 use the configuration structure to setup the utsname
Use the configuration structure, not the directory configuration

Signed-off-by: Daniel Lezcano <dlezcano@fr.ibm.com>
2009-10-09 11:38:38 +02:00
Daniel Lezcano
c69bd12f88 use the configuration structure for setting up the rootfs
use the configuration structure for setting up the rootfs

Signed-off-by: Daniel Lezcano <dlezcano@fr.ibm.com>
2009-10-09 11:38:38 +02:00
Daniel Lezcano
ecb0e51b0c use the configuration to check if a resource is enabled
Remove the usage of the directory config for the setup and use the
configuration structure instead.

Signed-off-by: Daniel Lezcano <dlezcano@fr.ibm.com>
2009-10-09 11:38:38 +02:00
Daniel Lezcano
df83bf6f97 Read the config file at restart
This patch makes the configuration to read the configuration
file in order to pass the configuration to the different functions.

Signed-off-by: Daniel Lezcano <dlezcano@fr.ibm.com>
2009-10-09 11:38:38 +02:00
Michel Normand
cfd1dc0932 keep rcfile for lxc-execute as already done for lxc-create
The code previously added in lxc-create with
commit d7efa8fcbf
is also required in lxc-execute.
So make this code common for the two callers.

Signed-off-by: Michel Normand <normand@fr.ibm.com>
Signed-off-by: Daniel Lezcano <dlezcano@fr.ibm.com>
2009-10-07 10:05:39 +02:00
Daniel Lezcano
1ac470c02a add some traces in the code for the logger
Add some traces in the code, so we are able to follow the execution
of the start command with the logger.

Signed-off-by: Daniel Lezcano <dlezcano@fr.ibm.com>
2009-07-24 15:25:45 +02:00
Daniel Lezcano
f5d186114c fix cgroup trace
The trace is displayed either if the setting fails, change that by
displaying the trace when the setting is successful.

Signed-off-by: Daniel Lezcano <dlezcano@fr.ibm.com>
2009-07-24 15:25:44 +02:00
Daniel Lezcano
cd54d859da make use of the logging facility and add some traces
Now we have a logging facility, let's use it and add some traces in
the code.

Signed-off-by: Daniel Lezcano <dlezcano@fr.ibm.com>
2009-07-22 19:39:17 +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
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
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
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
8b92dc3ab6 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>
2009-05-14 16:27:29 +02:00
Michel Normand
3ab87b66af 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>
2009-05-14 15:52:03 +02:00
Cedric Le Goater
36eb9bdef1 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>
2009-04-21 21:51:13 +02:00
Ryousei Takano
998ac6763f 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>
2009-04-20 22:10:59 +02:00
Môshe van der Sterre
b035ad62e6 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>
2009-04-20 22:10:59 +02:00
Daniel Lezcano
089cd8b878 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>
2009-03-30 14:02:19 +02:00
Daniel Lezcano
13954cce63 cleanup conf.h
Rename lxc_conf.h to conf.h

Signed-off-by: Daniel Lezcano <daniel.lezcano@free.fr>
2009-03-30 14:02:19 +02:00