]> git.proxmox.com Git - mirror_lxc.git/log
mirror_lxc.git
11 years agocoverity: free malloc'ed memory in error case
Dwight Engen [Tue, 7 May 2013 14:57:03 +0000 (10:57 -0400)]
coverity: free malloc'ed memory in error case

Signed-off-by: Dwight Engen <dwight.engen@oracle.com>
Acked-by: Serge E. Hallyn <serge.hallyn@ubuntu.com>
11 years agocoverity: fix dereference NULL return value
Dwight Engen [Fri, 3 May 2013 20:50:32 +0000 (16:50 -0400)]
coverity: fix dereference NULL return value

also break once we have found root, no need to search the rest of the mounts

Changelog: May 6: Serge: don't add the break.  (see m-l)

Signed-off-by: Dwight Engen <dwight.engen@oracle.com>
Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
11 years agosupport alternate container path in lxc-netstat.in
Harald Dunkel [Fri, 3 May 2013 08:53:43 +0000 (10:53 +0200)]
support alternate container path in lxc-netstat.in

Signed-off-by: Harald Dunkel <harald.dunkel@aixigo.de>
Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
11 years agolxc-create: add missing -P option for running lxc-destroy
Harald Dunkel [Fri, 3 May 2013 08:53:41 +0000 (10:53 +0200)]
lxc-create: add missing -P option for running lxc-destroy

Signed-off-by: Harald Dunkel <harald.dunkel@aixigo.de>
Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
11 years agosupport alternate container path in lxc-shutdown
Harald Dunkel [Fri, 3 May 2013 08:53:40 +0000 (10:53 +0200)]
support alternate container path in lxc-shutdown

Signed-off-by: Harald Dunkel <harald.dunkel@aixigo.de>
Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
11 years agocoverity: fix dereference before NULL check
Dwight Engen [Fri, 3 May 2013 20:50:20 +0000 (16:50 -0400)]
coverity: fix dereference before NULL check

also fixed some error strings while here

Signed-off-by: Dwight Engen <dwight.engen@oracle.com>
Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
11 years agoremove leftover debug cruft (thanks, Dwight)
Serge Hallyn [Fri, 3 May 2013 21:36:08 +0000 (16:36 -0500)]
remove leftover debug cruft (thanks, Dwight)

Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
11 years agocoverity: ftell returns a signed value
Dwight Engen [Fri, 3 May 2013 17:41:40 +0000 (13:41 -0400)]
coverity: ftell returns a signed value

The check for flen < 0 could never have been true since flen was declared
to be size_t (unsigned). Declare flen to be long since that is what ftell
returns.

Signed-off-by: Dwight Engen <dwight.engen@oracle.com>
Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
11 years agoconfile.c:config_network_ipv6_gateway: only define gw in needed scope
Serge Hallyn [Fri, 3 May 2013 17:28:06 +0000 (12:28 -0500)]
confile.c:config_network_ipv6_gateway: only define gw in needed scope

Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
11 years agocoverity: fix leak when ipv6 gw is auto
Dwight Engen [Fri, 3 May 2013 16:04:07 +0000 (12:04 -0400)]
coverity: fix leak when ipv6 gw is auto

Signed-off-by: Dwight Engen <dwight.engen@oracle.com>
Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
11 years agocoverity: fix leak in error case
Dwight Engen [Fri, 3 May 2013 16:04:01 +0000 (12:04 -0400)]
coverity: fix leak in error case

Since lxc_execute() is available through the library and is exposed via
the API we cannot be sure the caller will immediately exit, so we should
take care to free the allocated memory.

Signed-off-by: Dwight Engen <dwight.engen@oracle.com>
Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
11 years agocoverity: ensure string is null terminated, return in
Dwight Engen [Fri, 3 May 2013 15:29:39 +0000 (11:29 -0400)]
coverity: ensure string is null terminated, return in

 error case

Signed-off-by: Dwight Engen <dwight.engen@oracle.com>
Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
11 years agolxc_start: free the conf if starting the container fails
Weng Meiling [Fri, 3 May 2013 03:02:48 +0000 (11:02 +0800)]
lxc_start: free the conf if starting the container fails

When running lxc-start command with valgrind, it reports a memory leak error.
When lxc-start command fails, the conf which is from malloc has not been released.
This patch fix the problem.

Signed-off-by: Weng Meiling <wengmeiling.weng@huawei.com>
Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
11 years agoadd free conf->rcfile in lxc_conf_free
Weng Meiling [Fri, 3 May 2013 03:02:40 +0000 (11:02 +0800)]
add free conf->rcfile in lxc_conf_free

when releasing the conf, add free conf->rcfile which is from malloc

Signed-off-by: Weng Meiling <wengmeiling.weng@huawei.com>
Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
11 years agoubuntu templates: add comments to show how to enable nesting
Serge Hallyn [Thu, 2 May 2013 21:28:10 +0000 (16:28 -0500)]
ubuntu templates: add comments to show how to enable nesting

Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
11 years agoclone: a few fixes
Serge Hallyn [Thu, 2 May 2013 04:37:05 +0000 (23:37 -0500)]
clone: a few fixes

clean up error case in clone, which in particular could cause double
lxc_container_put(c2)

for overlayfs, handle (with error message) all bdev types.

Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
11 years agoallow lxc-init to log when rootfs not given
Dwight Engen [Wed, 1 May 2013 23:07:16 +0000 (19:07 -0400)]
allow lxc-init to log when rootfs not given

On Mon, 29 Apr 2013 14:44:47 -0500
Serge Hallyn <serge.hallyn@ubuntu.com> wrote:

> Quoting Dwight Engen (dwight.engen@oracle.com):
> > So I did this, only to realize that lxc-init is passing "none" for
> > the file anyway, so it currently doesn't intend to log. This makes
> > me think that passing NULL for lxcpath is the right thing to do in
> > this patch. If you want me to make it so lxc-init can log, I can do
> > that but I think it should be in a different change :)
>
> That actually would be very useful, but as you say that's a different
> feature - thanks.

... and here is said change.

Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
11 years agotemplates: deny writes to host's clock (v2)
Serge Hallyn [Wed, 1 May 2013 13:33:12 +0000 (08:33 -0500)]
templates: deny writes to host's clock (v2)

Don't allow write to /dev/rtc0, and remove sys_time.

Thanks, Christoph.

v2: drop sys_time, sys_module, mac_admin and mac_override in
all templates.

Reported-by: Christoph Mitasch <cmitasch@thomas-krenn.com>
Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
11 years agolog.c: always use dir when lxcpath is not default
Dwight Engen [Tue, 30 Apr 2013 20:33:18 +0000 (16:33 -0400)]
log.c: always use dir when lxcpath is not default

Signed-off-by: Dwight Engen <dwight.engen@oracle.com>
Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
11 years agolxc.functions.in: add missing backquote
Serge Hallyn [Tue, 30 Apr 2013 19:45:32 +0000 (14:45 -0500)]
lxc.functions.in: add missing backquote

Reported by both Dwight and S.Çağlar - thanks.

Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
11 years agolxc.functions.in: use the right parameter to lxc-config to get lxcpath
Serge Hallyn [Tue, 30 Apr 2013 19:23:08 +0000 (14:23 -0500)]
lxc.functions.in: use the right parameter to lxc-config to get lxcpath

Reported-by: S.Çağlar Onur <caglar@10ur.org>
Signed-off-by: Dwight Engen <dwight.engen@oracle.com>
Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
11 years agoremove lxc-clone-sh
Serge Hallyn [Tue, 30 Apr 2013 19:20:40 +0000 (14:20 -0500)]
remove lxc-clone-sh

Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
11 years agoUpdate .gitignore
S.Çağlar Onur [Tue, 30 Apr 2013 18:55:04 +0000 (14:55 -0400)]
Update .gitignore

Signed-off-by: S.Çağlar Onur <caglar@10ur.org>
Signed-off-by: Serge E. Hallyn <serge.hallyn@ubuntu.com>
11 years agosilence "sh: 1: zfs: not found" errors on systems without ZFS
S.Çağlar Onur [Tue, 30 Apr 2013 18:55:03 +0000 (14:55 -0400)]
silence "sh: 1: zfs: not found" errors on systems without ZFS

Signed-off-by: S.Çağlar Onur <caglar@10ur.org>
Signed-off-by: Serge E. Hallyn <serge.hallyn@ubuntu.com>
11 years agointroduce lxc_config
Serge Hallyn [Mon, 29 Apr 2013 20:09:06 +0000 (22:09 +0200)]
introduce lxc_config

It's a tiny program (exported through the api) wrapping the util.c
helpers for reading /etc/lxc/lxc.conf variables, and replaces
the kludgy shell duplication in lxc.functions.in

Changelog: Apr 30: address feedback from Dwight
(exit error on failure, and use 'lxcpath' as name, not
'default_path').

Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
Acked-by: Dwight Engen <dwight.engen@oracle.com>
11 years agoadd vg and zfsroot options to lxc.functions and use in lxc-create
Serge Hallyn [Mon, 29 Apr 2013 12:50:30 +0000 (14:50 +0200)]
add vg and zfsroot options to lxc.functions and use in lxc-create

also make sure to drop spaces between = and variable in lxc.conf

Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
11 years agoallow site-wide customization of zfsroot and lvm vg
Serge Hallyn [Sat, 27 Apr 2013 02:59:11 +0000 (04:59 +0200)]
allow site-wide customization of zfsroot and lvm vg

/etc/lxc/lxc.conf can contain

zfsroot = custom1
lvm_vg = vg0

(Otherwise the defaults are 'lxc' for lvm_vg, and 'lxc' for zfsroot)

Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
11 years agoSeveral backing store improvements
Serge Hallyn [Fri, 26 Apr 2013 16:00:28 +0000 (18:00 +0200)]
Several backing store improvements

allow copy clones from other bdevs

for lvm and zfs, as we don't yet support passing options, only default
VG of 'lxc' and default zfsroot of 'tank' are supported when converting
another backing store type.

refuse deletion of container which has lvm or zfs snapshots.
Note that since a zfs clone must be made from a zfs snapshot,
which is made from the original zfs fs, even after we
lxc-destroy the snapshotted container we still must manually
remove the snapshot.  This can be handled automatically, by
looking for snapshots where c1 is the original, c2 is the clone,
tank/c2 no longer exists, but tank/c1@c2 does.  We can then
remove tank/c1@c2 and feel free to remove tank/c1.  This patch
does NOT do that yet.

Make sure not to return when we're a forked child.

Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
11 years agoimplement zfs bdev and clone
Serge Hallyn [Thu, 25 Apr 2013 22:14:37 +0000 (00:14 +0200)]
implement zfs bdev and clone

Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
11 years agoimplement backend drivers and container clone API (v3)
Serge Hallyn [Tue, 16 Apr 2013 13:07:05 +0000 (08:07 -0500)]
implement backend drivers and container clone API (v3)

1. commonize waitpid users to use a single helper.  We frequently want
to run something in a clean namespace, or fork off a script.  This
lets us keep the function doing fork:(1)exec(2)waitpid simpler.

2. start a blockdev backend implementation.  This will be used for
mounting, copying, and snapshotting container filesystems.

3. implement btrfs, lvm, directory, and overlayfs backends.

4. For overlayfs, support a new lxc.rootfs format of
'bdevtype:<extra>'.  This means you can now use overlayfs-based
containers without using lxc-start-ephemeral, by using
lxc.rootfs = overlayfs:/readonly-dir:writeable-dir

5. add a set of simple clone testcases

6. Write a new lxc_clone.c based on api clone.

Still to do (there's more, but off top of my head):

1. support zfs, aufs
2. have clone handle other mount entries (right now it only clones
the rootfs)
3. python, lua, and go bindings (not me :)
4. lxc-destroy: if lvm backing store, check for snapshots of it.
   (what about directories which have overlayfs clones?)

Changes since v2:
Initialize random generator when picking new macaddr (reported
  by caglar@10ur.org)
Fix wrong use of bitmask flags
On copy-clone of btrfs, create a subvolume
lxc_clone.c: respect the command line usage of the old script
lxc-clone(1): update documentation
Refuse to try changing backing stores expect to overlayfs, as
  it is not implemented (yet) anyway.

Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
Conflicts:
src/lxc/utils.h

11 years agoCreate log file in lxcpath for non-system containers
Dwight Engen [Mon, 29 Apr 2013 18:54:08 +0000 (14:54 -0400)]
Create log file in lxcpath for non-system containers

On Fri, 26 Apr 2013 10:18:12 -0500
Serge Hallyn <serge.hallyn@ubuntu.com> wrote:

> Quoting Dwight Engen (dwight.engen@oracle.com):
> > On Fri, 26 Apr 2013 09:37:49 -0500
> > Serge Hallyn <serge.hallyn@ubuntu.com> wrote:
> >
> > > Quoting Dwight Engen (dwight.engen@oracle.com):
> > > > Using lxc configured with --enable-configpath-log, and
> > > > specifying a path to the lxc commands with -P, the log file
> > > > path is generated with a basename of LOGPATH instead of the
> > > > lxcpath. This means for example if you do
> > > >
> > > > lxc-start -P /tmp/containers -n test01 -l INFO
> > > >
> > > > your log file will be
> > > >
> > > > /var/lib/lxc/test01/test01.log
> > > >
> > > > I was expecting the log to be /tmp/containers/test01/test01.log.
> > > > This is particularly confusing if you also have test01 on the
> > > > regular lxcpath. The patch below changes the log file path to be
> > > > based on lxcpath rather than LOGPATH when lxc is configured with
> > > > --enable-configpath-log.
> > > >
> > > > I think that even in the normal non --enable-configpath-log case
> > > > we should consider using lxcpath as the base and not having
> > > > LOGPATH at all, as attempting to create the log files
> > > > in /var/log is not going to work for regular users on their own
> > > > lxcpath. If we want that, I'll update the patch to do that as
> > > > well.
> > >
> > >
> > > Perhaps we should do:
> > >
> > >  1. If lxcpath == default_lxc_path(), then first choice is
> > >     LOGPATH, second is lxcpath/container.log
> > >  2. when opening, if first choice fails, use second choice
> > >     if there is any.
> > >
> > > That way 'system' containers will go to /var/log/lxc, as I think
> > > they should.  Custom-lxcpath containers should never go
> > > to /var/log/lxc, since their names could be dups of containers in
> > > default_lxc_path(). And if the system is a weird one where
> > > default_lxc_path is set up so that an unprivileged user can use
> > > it, then we should log into $lxcpath.
> >
> > That sounds good to me. So these rules would apply in both the
> > regular and --enable-configpath-log cases.

I updated the patch to try to open the log file according to the
choices given above. Along the way I cleaned up log.c a bit, making
some things static, grouping external interfaces together, etc...
Hopefully that doesn't add too much noise.

> > > (Note this patch will trivially conflict with my new lxc_clone.c
> > > causing it to fail to build - unfortunate result of timing)
> >
> > Yeah unfortunately this touches every lxc_log_init() caller. I can
> > work on the above logic and re-submit after your new lxc_clone
> > stuff goes in.
>
> No no, I'll just need to remember to update mine.  Don't hold up on
> mine, this is just the nature of such collaboration  :)
>
> > Did you have any thoughts on the XXX what to pass in for lxcpath in
> > lxc_init? Right now it just falls back to LOGPATH.
>
> No - that's a weird one, since lxc_init runs in the container.  If
> there were only system containers I'd say always use LOGPATH.
> However there are people (apparently :) who use container sharing the
> host's rootfs...
>
> lxc-execute does know the lxcpath.  Perhaps we can simply have
> src/lxc/execute.c:execute_start() look at handler->conf to see if a
> rootfs is set.  If rootfs is NOT set, then pass lxcpath along to
> lxc-init.  Then lxc-init can mostly do the same as the others?  (It
> doesn't use src/lxc/arguments.c, so you'd have to add lxcpath to
> options[] in lxc-init.c)

So I did this, only to realize that lxc-init is passing "none" for the
file anyway, so it currently doesn't intend to log. This makes me
think that passing NULL for lxcpath is the right thing to do in
this patch. If you want me to make it so lxc-init can log, I can do
that but I think it should be in a different change :)

--

Signed-off-by: Dwight Engen <dwight.engen@oracle.com>
Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
11 years agofix building docs
Dwight Engen [Mon, 29 Apr 2013 20:47:35 +0000 (16:47 -0400)]
fix building docs

Commit 69fe23ff added checking for the older docbook2man back into
configure, but this breaks building the docs on at least Oracle Linux and
Fedora when docbook2X is not installed as docbook2man will be found but the
docs don't actually build with that tool.

This change makes it so the docs can be built with either the older
docbook2man or the newer 2X tools by using configure to set the dtd
string to an appropriate value depending on use of docbook2man or
db2x_docbook2man.

Also fixed a small error in lxc-destroy.sgml.in that was noticed
by the old tools.

Signed-off-by: Dwight Engen <dwight.engen@oracle.com>
Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
11 years agoadd zfs support to lxc-create and lxc-destroy
Serge Hallyn [Thu, 25 Apr 2013 20:18:25 +0000 (15:18 -0500)]
add zfs support to lxc-create and lxc-destroy

This is based on patch from Papp Tamas (thanks).  It also does some
reorganizing of lxc-create to commonize some of the backingstore handling.

I played with it using:

sudo lvcreate -L 100G -n zfs vg0
sudo zpool create lxc /dev/vg0/zfs
sudo lxc-create -B zfs --zfsroot lxc -t ubuntu -n dir2

or you could

qemu-img create zfs.img 100G
sudo qemu-nbd -c /dev/nbd0 zfs.img
sudo zpool create lxc /dev/nbd0
sudo lxc-create -B zfs --zfsroot lxc -t ubuntu -n dir2

I'll write the bdev.c handler and hook up lxc-clone next.

This also fixses a bug in the sed expression to extract the rootfs from
container config, which prepended an extra '/' to the rootdev.  (That
caused the zfs list entry not to match at destroy)

Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
Cc: Papp Tamas <tompos@martos.bme.hu>
Acked-by: Stéphane Graber <stgraber@ubuntu.com>
11 years agolxc_wait should start monitord
Dwight Engen [Thu, 25 Apr 2013 16:21:53 +0000 (12:21 -0400)]
lxc_wait should start monitord

If lxc_wait is called before the container has started the socket will not
yet have been created and lxc_wait's connect to it will fail. Starting the
daemon will create the socket for lxc_wait to connect to.

Signed-off-by: Dwight Engen <dwight.engen@oracle.com>
Acked-by: Serge E. Hallyn <serge.hallyn@ubuntu.com>
11 years agolxc_attach: Use clone() instead of second fork()
Christian Seiler [Thu, 25 Apr 2013 11:00:19 +0000 (13:00 +0200)]
lxc_attach: Use clone() instead of second fork()

Because of an assertion in glibc's fork() wrapper that parent pid and
pid of child should never be the same, one should avoid fork() after
attaching to a PID namespace, since the pid inside the namespace may
coincide with the pid of the parent outside the namespace, thus hitting
the aforementioned assertion.

This patch just changes the code in the most simple manner to use
clone() instead of fork(). Since clone() requires a function to be
called instead of returning 0, we move the code of the child into a
function child_main.

Signed-off-by: Christian Seiler <christian@iwakd.de>
Acked-by: Serge E. Hallyn <serge.hallyn@ubuntu.com>
11 years agolxc.conf: Add reference to capabilities manpage
Stéphane Graber [Thu, 25 Apr 2013 15:31:34 +0000 (17:31 +0200)]
lxc.conf: Add reference to capabilities manpage

This adds a reference to capabilities(7) to the lxc.conf manpage.

Signed-off-by: Tomáš Pospíšek <tpo_deb@sourcepole.ch>
Acked-by: Stéphane Graber <stgraber@ubuntu.com>
11 years agoconfigure: support for the "docbook2man" utility to build the documentation
Peter Simons [Thu, 25 Apr 2013 10:20:30 +0000 (12:20 +0200)]
configure: support for the "docbook2man" utility to build the documentation

This adds docbook2man as an alternative name for the docbook compiler.
As that name was used on Debian based systems for an older version of the tool,
this change also adds a check so that docbook2man is never used on Debian based
systems.

Reported-by: Peter Simons <simons@cryp.to>
Reported-by: Christian Bühler christian@cbuehler.de
Signed-off-by: Stéphane Graber <stgraber@ubuntu.com>
Acked-by: Serge E. Hallyn <serge.hallyn@ubuntu.com>
11 years agoRevert "monitor.c: sanity check on waitpid return value"
Serge Hallyn [Thu, 25 Apr 2013 03:47:50 +0000 (22:47 -0500)]
Revert "monitor.c: sanity check on waitpid return value"

It's reported to errors in parallel starts.

Reported-by: "S.Çağlar Onur" <caglar@10ur.org>
This reverts commit 6b7916695264238a490971e8cd87612154fc18b1.

11 years agomonitor.c: sanity check on waitpid return value
Serge Hallyn [Thu, 25 Apr 2013 00:59:10 +0000 (19:59 -0500)]
monitor.c: sanity check on waitpid return value

Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
11 years agoclose fd on error path
Serge Hallyn [Thu, 25 Apr 2013 00:49:59 +0000 (19:49 -0500)]
close fd on error path

Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
11 years agolxc-create: cleanup whenever exiting with error
Serge Hallyn [Wed, 24 Apr 2013 20:16:21 +0000 (15:16 -0500)]
lxc-create: cleanup whenever exiting with error

Otherwise we leave bad containers sitting around and further confuse
things on retries.

Reported-by: Mukanyiligira Didacienne <siyana223@gmail.com>
Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
Acked-by: Stéphane Graber <stgraber@ubuntu.com>
11 years agoAllow multiple monitor clients
Dwight Engen [Wed, 24 Apr 2013 19:06:20 +0000 (15:06 -0400)]
Allow multiple monitor clients

This fixes a long standing issue that there could only be a single
lxc-monitor per container.

With this change, a new lxc-monitord daemon is spawned the first time
lxc-monitor is called against the container and will accept connections
from any subsequent lxc-monitor.

Signed-off-by: Dwight Engen <dwight.engen@oracle.com>
Acked-by: Serge E. Hallyn <serge.hallyn@ubuntu.com>
11 years agoubuntu: Don't break when the locale is C.*
Stéphane Graber [Wed, 24 Apr 2013 19:38:32 +0000 (21:38 +0200)]
ubuntu: Don't break when the locale is C.*

Update the code to also match C.* so that C.UTF-8 doesn't make the
container creation fail.

Signed-off-by: Stéphane Graber <stgraber@ubuntu.com>
Acked-by: Serge E. Hallyn <serge.hallyn@ubuntu.com>
11 years agoSupport starting containers concurrently
S.Çağlar Onur [Tue, 23 Apr 2013 21:24:31 +0000 (17:24 -0400)]
Support starting containers concurrently

Trying to start multiple containers concurrently may cause
lxc_monitor_read_timeout to fail as select call could be
interrupted by a signal, handle it.

Signed-off-by: S.Çağlar Onur <caglar@10ur.org>
Acked-by: Stéphane Graber <stgraber@ubuntu.com>
11 years agopython: Make the code compatibly with 3.2
Stéphane Graber [Wed, 24 Apr 2013 15:24:26 +0000 (17:24 +0200)]
python: Make the code compatibly with 3.2

The previous change used some 3.3-specific functions.
We still support 3.2 so revert to 3.2-compatible calls.

Reported-by: S.Çağlar Onur <caglar@10ur.org>
Signed-off-by: Stéphane Graber <stgraber@ubuntu.com>
Acked-by: Serge E. Hallyn <serge.hallyn@ubuntu.com>
11 years agopython: Fix convert_tuple_to_char_pointer_array
Stéphane Graber [Tue, 23 Apr 2013 22:50:44 +0000 (00:50 +0200)]
python: Fix convert_tuple_to_char_pointer_array

This finally fixes a few issues with the magic
convert_tuple_to_char_pointer_array function.

This now clearly copies the char* from the python object so we don't
end up keeping reference to those.

Also add the few required free calls to free the content of the array.

Signed-off-by: Stéphane Graber <stgraber@ubuntu.com>
Acked-by: Serge E. Hallyn <serge.hallyn@ubuntu.com>
11 years agocgroup: Remove unused mntent variables
Stéphane Graber [Wed, 24 Apr 2013 09:41:45 +0000 (11:41 +0200)]
cgroup: Remove unused mntent variables

Spotted by coverity, we were now assigning mntent but only every using
mntent_r, so drop those variables and assignation.

Signed-off-by: Stéphane Graber <stgraber@ubuntu.com>
11 years agoSupport stopping containers concurrently
S.Çağlar Onur [Wed, 17 Apr 2013 21:15:51 +0000 (17:15 -0400)]
Support stopping containers concurrently

Trying to stop multiple containers concurrently ends up with "cgroup is not mounted" errors as multiple threads corrupts the shared variables.
Fix that stack corruption and start to use getmntent_r to support stopping multiple containers concurrently.

Signed-off-by: S.Çağlar Onur <caglar@10ur.org>
Acked-by: Serge E. Hallyn <serge.hallyn@ubuntu.com>
11 years agodetect APT_PROXY from host apt.conf
Serge Hallyn [Tue, 23 Apr 2013 13:37:41 +0000 (08:37 -0500)]
detect APT_PROXY from host apt.conf

Introduce a new HTTP_PROXY variable in /etc/default/lxc.  If unset or
set to none, then behavior continues as before.  If set to 'apt', then
any http::proxy set in apt.conf will be used as http_proxy for
debootstrap, and specified in the container's
/etc/apt/apt.conf.d/70proxy.  If set to something else, then the
value of HTTP_PROXY will be used as http_proxy for debootstrap and
specified in the container's 70proxy.

Changelog: (apr 23) merge the two apt proxy detection functions.

Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
Acked-by: Stéphane Graber <stgraber@ubuntu.com>
11 years agogoto correct cleanup label to ensure fd is closed
Dwight Engen [Mon, 22 Apr 2013 18:02:30 +0000 (14:02 -0400)]
goto correct cleanup label to ensure fd is closed

Signed-off-by: Dwight Engen <dwight.engen@oracle.com>
Acked-by: Serge E. Hallyn <serge.hallyn@ubuntu.com>
11 years agoremove needless check for 'line' which cannot be NULl there
Serge Hallyn [Mon, 22 Apr 2013 20:46:26 +0000 (15:46 -0500)]
remove needless check for 'line' which cannot be NULl there

(found by coverity)

Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
11 years agocgpath test: don't check path len before checking if it is null
Serge Hallyn [Mon, 22 Apr 2013 20:40:57 +0000 (15:40 -0500)]
cgpath test: don't check path len before checking if it is null

Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
11 years agomake lxc_af_unix_open() safely return error on long pathnames
Dwight Engen [Mon, 22 Apr 2013 15:16:57 +0000 (11:16 -0400)]
make lxc_af_unix_open() safely return error on long pathnames

Signed-off-by: Dwight Engen <dwight.engen@oracle.com>
Acked-by: Serge E. Hallyn <serge.hallyn@ubuntu.com>
11 years agopython: Fix get_ips and nesting with lxcpath
Stéphane Graber [Sun, 21 Apr 2013 20:42:06 +0000 (22:42 +0200)]
python: Fix get_ips and nesting with lxcpath

When using -P (lxcpath), the parameter path needs to be forwarded
to the various commands being run but not used by the nested lxc-ls
as it's relatively unlikely that both the host and the nested containers
use a custom path.

This isn't ideal but short of having a way to provide the container path
for every single of the nesting (with potential unlimited depth), it's
the best we can do.

Signed-off-by: Stéphane Graber <stgraber@ubuntu.com>
Acked-by: Serge E. Hallyn <serge.hallyn@ubuntu.com>
11 years agoubuntu: Various fixes
Stéphane Graber [Sun, 21 Apr 2013 18:09:24 +0000 (20:09 +0200)]
ubuntu: Various fixes

 - Drop disabled entries from allowed devices list
 - Improve generated config layout a bit
 - Drop redundant uname call
 - Re-generate the SSH host keys on container creation

Signed-off-by: Stéphane Graber <stgraber@ubuntu.com>
Acked-by: Serge E. Hallyn <serge.hallyn@ubuntu.com>
11 years agoUse "uname -m" instead of "arch"
Christian Bühler [Sat, 20 Apr 2013 13:50:13 +0000 (15:50 +0200)]
Use "uname -m" instead of "arch"

According to "arch"'s manpage, it's identical to "uname -m".

Some distros ship uname but don't ship arch, however all distros ship uname,
therefore it makes sense to use "uname -m" whenever possible.

Signed-off-by: Christian Bühler <christian@cbuehler.de>
Acked-by: Stéphane Graber <stgraber@ubuntu.com>
11 years agopython: Various fixes to the python scripts
Stéphane Graber [Thu, 18 Apr 2013 20:20:53 +0000 (22:20 +0200)]
python: Various fixes to the python scripts

This fixes a few issues uncovered by the recent C module fix.

In lxc-start-ephemeral, the hwaddr code wasn't actually working.
Replace by code that properly iterates through the network interfaces
and sets a new MAC address for each entry.

In the python overlay, catch the newly emitted KeyError when in
set_config_item (or setting any previously unset variable would fail).

Signed-off-by: Stéphane Graber <stgraber@ubuntu.com>
Acked-by: Serge E. Hallyn <serge.hallyn@ubuntu.com>
11 years agopython: Lots of fixes in C extension
Stéphane Graber [Fri, 12 Apr 2013 09:19:56 +0000 (11:19 +0200)]
python: Lots of fixes in C extension

Fixes a lot of issues found by a code review done by Barry Warsaw.

Those include:
 - Wrong signature for getters
 - Various memory leaks
 - Various optimizations
 - More consistent return values
 - Proper exception handling

Signed-off-by: Stéphane Graber <stgraber@ubuntu.com>
Reported-by: Barry Warsaw <barry@ubuntu.com>
Acked-by: Barry Warsaw <barry@ubuntu.com>
Acked-by: Serge E. Hallyn <serge.hallyn@ubuntu.com>
11 years agoutils: reimplement/fix mkdir_p() (v2)
Richard Weinberger [Wed, 17 Apr 2013 21:54:09 +0000 (23:54 +0200)]
utils: reimplement/fix mkdir_p() (v2)

Reimplement mkdir_p() such that it:
 ...handles relativ paths correctly. (currently it crashes)
 ...does not rely on dirname().
 ...is not recursive.
 ...is shorter. ;-)

Signed-off-by: Richard Weinberger <richard@nod.at>
Acked-by: Serge E. Hallyn <serge.hallyn@ubuntu.com>
11 years agoRevert "start: Detect early failure of the new child"
Stéphane Graber [Thu, 18 Apr 2013 08:30:33 +0000 (10:30 +0200)]
Revert "start: Detect early failure of the new child"

This reverts commit 5a5c35c3a01afec515e688c8366e6f893985518d.

This commit was preventing startup of containers using lxc hooks and
shutdown of all other containers, requiring the use of a good old
kill -9 to get rid of lxc-start after a container shutdown.

Signed-off-by: Stéphane Graber <stgraber@ubuntu.com>
11 years agoRevert "utils: reimplement/fix mkdir_p()"
Stéphane Graber [Thu, 18 Apr 2013 08:29:44 +0000 (10:29 +0200)]
Revert "utils: reimplement/fix mkdir_p()"

This reverts commit 8de4140644f01180f2fdab55b0ab0f13d1c761c6.

This commit was preventing container startup on my machine, making them
all fail with various "No such file or directory" errors.

Signed-off-by: Stéphane Graber <stgraber@ubuntu.com>
11 years agoutils: reimplement/fix mkdir_p()
Richard Weinberger [Wed, 17 Apr 2013 15:13:40 +0000 (17:13 +0200)]
utils: reimplement/fix mkdir_p()

Reimplement mkdir_p() such that it:
 ...handles relativ paths correctly. (currently it crashes)
 ...does not rely on dirname().
 ...is not recursive.
 ...is shorter. ;-)

Signed-off-by: Richard Weinberger <richard@nod.at>
Acked-by: Serge E. Hallyn <serge.hallyn@ubuntu.com>
11 years agostart: Detect early failure of the new child
Richard Weinberger [Tue, 16 Apr 2013 21:42:23 +0000 (23:42 +0200)]
start: Detect early failure of the new child

If the process in the new namespace dies very early
we have currently no chance to detect this.
The parent process will just die due to SIGPIPE
if it write to the fd used for synchronisation and
nobody will notice the real cause of the problem.

Install a SIGCHLD handler to detect the death.
Later when the child does execve() to the init within
the new namespace the handler will be disabled automatically.

Signed-off-by: Richard Weinberger <richard@nod.at>
Acked-by: Serge E. Hallyn <serge.hallyn@ubuntu.com>
11 years agoinit: Fix whitespace damage
Richard Weinberger [Tue, 16 Apr 2013 21:48:16 +0000 (23:48 +0200)]
init: Fix whitespace damage

While we are here, fix the whitespace damage.

Signed-off-by: Richard Weinberger <richard@nod.at>
Acked-by: Serge E. Hallyn <serge.hallyn@ubuntu.com>
11 years agoinit: unnest interrupt_handler
Richard Weinberger [Tue, 16 Apr 2013 21:48:15 +0000 (23:48 +0200)]
init: unnest interrupt_handler

There is no need to use nested functions voodoo.

Signed-off-by: Richard Weinberger <richard@nod.at>
Acked-by: Serge E. Hallyn <serge.hallyn@ubuntu.com>
11 years agoquiet gcc 4.4.7 warning about saveptr use before initialization
Dwight Engen [Tue, 16 Apr 2013 15:47:29 +0000 (11:47 -0400)]
quiet gcc 4.4.7 warning about saveptr use before initialization

The recent change to use strtok_r causes a build warning with this older
gcc version, so initialize saveptr to NULL to quiet the compiler and
unbreak the build. There was no warning with gcc 4.7.2 that I
originally tested with.

Signed-off-by: Dwight Engen <dwight.engen@oracle.com>
Acked-by: Stéphane Graber <stgraber@ubuntu.com>
11 years agofix spacing
Serge Hallyn [Tue, 16 Apr 2013 12:41:17 +0000 (07:41 -0500)]
fix spacing

Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
11 years agomkdir_p: account for '//foo/bar'
Serge Hallyn [Tue, 16 Apr 2013 12:35:05 +0000 (07:35 -0500)]
mkdir_p: account for '//foo/bar'

As Richard reported, dirname('//') returns //.  But mkdir_p only stops
when called with '/', resulting in infinite recursion when given a
pathname '//foo/bar'.

Reported-by: richard -rw- weinberger <richard.weinberger@gmail.com>
Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
11 years agolxc-template: enable chroot + chpasswd functionality for Busybox hosts
Bogdan Purcareata [Thu, 11 Apr 2013 13:29:44 +0000 (16:29 +0300)]
lxc-template: enable chroot + chpasswd functionality for Busybox hosts

This patch supports the scenario where a user wants to install a
busybox container on a busybox host.

When running the template, in order to change the root password,
the template needs to do the chroot. On busybox-powered hosts, chroot
is not part of the coreutils package - it's part of busybox. And the
busybox implementation or chroot only works if it has /lib in the new
root populated with the right binaries (or at least that's the
solution I found to make it work).

The temporarily bind-mounts /lib in the NEWROOT, chroots there,
changes the password, goes back and unmounts. This set of operations
is contained in a new MOUNT namespace, using the lxc-unshare call.

Signed-off-by: Bogdan Purcareata <bogdan.purcareata@freescale.com>
Acked-by: Serge E. Hallyn <serge.hallyn@ubuntu.com>
11 years agofix checking hook script exit code
Dwight Engen [Mon, 15 Apr 2013 17:43:14 +0000 (13:43 -0400)]
fix checking hook script exit code

pclose returns the exit status from wait, we need to check that to see if
the script itself failed or not. Tested a script that returned 0, 1, and
also one that did a sleep and then was killed by a signal.

Signed-off-by: Dwight Engen <dwight.engen@oracle.com>
Acked-by: Serge E. Hallyn <serge.hallyn@ubuntu.com>
11 years agofortify: use reentrant safe strtok_r
Dwight Engen [Mon, 15 Apr 2013 19:28:07 +0000 (15:28 -0400)]
fortify: use reentrant safe strtok_r

Signed-off-by: Dwight Engen <dwight.engen@oracle.com>
Acked-by: Serge E. Hallyn <serge.hallyn@ubuntu.com>
11 years agofortify: minor cleanups for unused variables, stricter types
Dwight Engen [Mon, 15 Apr 2013 19:59:12 +0000 (15:59 -0400)]
fortify: minor cleanups for unused variables, stricter types

Signed-off-by: Dwight Engen <dwight.engen@oracle.com>
Acked-by: Serge E. Hallyn <serge.hallyn@ubuntu.com>
11 years agofortify: check the value returned from write(2)
Dwight Engen [Mon, 15 Apr 2013 19:40:53 +0000 (15:40 -0400)]
fortify: check the value returned from write(2)

Also check that we wrote the amount we expected to. The write on the pty
is blocking but we could still get a short write on EINTR, so we should
SYSERROR it.

Signed-off-by: Dwight Engen <dwight.engen@oracle.com>
Acked-by: Serge E. Hallyn <serge.hallyn@ubuntu.com>
11 years agofix lxc-attach usage
Dwight Engen [Mon, 15 Apr 2013 20:05:36 +0000 (16:05 -0400)]
fix lxc-attach usage

This makes it match the manpage and be consistent with lxc-execute

Signed-off-by: Dwight Engen <dwight.engen@oracle.com>
Acked-by: Serge E. Hallyn <serge.hallyn@ubuntu.com>
11 years agofix coverity-found errors.
Serge Hallyn [Mon, 15 Apr 2013 03:57:46 +0000 (22:57 -0500)]
fix coverity-found errors.

Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
11 years agocoverity resource leak fixes
Serge Hallyn [Mon, 15 Apr 2013 03:44:09 +0000 (22:44 -0500)]
coverity resource leak fixes

Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
11 years agofix coverity-found resource leaks on error paths.
Serge Hallyn [Mon, 15 Apr 2013 03:22:10 +0000 (22:22 -0500)]
fix coverity-found resource leaks on error paths.

Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
11 years agofix coverity-found resource leaks in config_network_ipv6
Serge Hallyn [Mon, 15 Apr 2013 03:16:26 +0000 (22:16 -0500)]
fix coverity-found resource leaks in config_network_ipv6

Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
11 years agofix free of alloca()d buffer (found by coverity)
Serge Hallyn [Mon, 15 Apr 2013 03:02:03 +0000 (22:02 -0500)]
fix free of alloca()d buffer (found by coverity)

Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
11 years agofix resource leak of netdev on error path found by coverity
Serge Hallyn [Mon, 15 Apr 2013 02:59:02 +0000 (21:59 -0500)]
fix resource leak of netdev on error path found by coverity

Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
11 years agofix resource leak of utsname in error path found by coverity
Serge Hallyn [Mon, 15 Apr 2013 02:56:51 +0000 (21:56 -0500)]
fix resource leak of utsname in error path found by coverity

Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
11 years agogenl.c: fix a resource leak found by coverity
Serge Hallyn [Mon, 15 Apr 2013 02:48:49 +0000 (21:48 -0500)]
genl.c: fix a resource leak found by coverity

Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
11 years agolxcapi_create: fix leak of tpath when a container already exists
Serge Hallyn [Mon, 15 Apr 2013 02:45:00 +0000 (21:45 -0500)]
lxcapi_create: fix leak of tpath when a container already exists

Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
11 years agolxc_monitor: make sure msg.name is null terminated (bug found by coverity)
Serge Hallyn [Mon, 15 Apr 2013 02:39:34 +0000 (21:39 -0500)]
lxc_monitor: make sure msg.name is null terminated (bug found by coverity)

Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
11 years agoifdef out skipped startone test code
Serge Hallyn [Mon, 15 Apr 2013 02:18:53 +0000 (21:18 -0500)]
ifdef out skipped startone test code

Unfortunately installing a working lxc-init is somewhat hairy and
distro-dependent.  So we skipped it before, but Coverity didn't
like that, so just ifdef it out.

Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
11 years agolxccontaienr: fix missing va_end in error case.
Serge Hallyn [Mon, 15 Apr 2013 02:17:09 +0000 (21:17 -0500)]
lxccontaienr: fix missing va_end in error case.

Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
11 years agolxcccontainer: add missing va_end found by coverity
Serge Hallyn [Mon, 15 Apr 2013 02:12:58 +0000 (21:12 -0500)]
lxcccontainer: add missing va_end found by coverity

Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
11 years agoaf_unix.c: fix coverity-found bug: pass addr size
Serge Hallyn [Fri, 12 Apr 2013 20:15:22 +0000 (15:15 -0500)]
af_unix.c: fix coverity-found bug: pass addr size

Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
11 years agolxclock: fix coverity-found leak
Serge Hallyn [Fri, 12 Apr 2013 20:11:29 +0000 (15:11 -0500)]
lxclock: fix coverity-found leak

if sem_init fails, free what we mallocd.

Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
11 years agolxclock: indentation
Serge Hallyn [Fri, 12 Apr 2013 20:11:11 +0000 (15:11 -0500)]
lxclock: indentation

Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
11 years agoFix up struct lxc_container locking
Serge Hallyn [Thu, 11 Apr 2013 16:43:31 +0000 (11:43 -0500)]
Fix up struct lxc_container locking

1. in container_free, set c->privlock to NULL before calling
sem_destroy, to prevent a window where another thread could call
sem_wait(c->privlock) while c->privlock is not NULL but is already
destroyed.

2. in container_get, check for numthreads < 0 before calling lxclock.
Once numthreads is 0, it never goes back up.

Following is a comment added to lxccontainer.c:

/*
 * Consider the following case:
freer                         |    racing get()er
==================================================================
lxc_container_put()           |   lxc_container_get()
\ lxclock(c->privlock)        |   c->numthreads < 1? (no)
\ c->numthreads = 0           |   \ lxclock(c->privlock) -> waits
\ lxcunlock()                 |   \
\ lxc_container_free()        |   \ lxclock() returns
                              |   \ c->numthreads < 1 -> return 0
\ \ (free stuff)              |
\ \ sem_destroy(privlock)     |

 * When the get()er checks numthreads the first time, one of the following
 * is true:
 * 1. freer has set numthreads = 0.  get() returns 0
 * 2. freer is between lxclock and setting numthreads to 0.  get()er will
 *    sem_wait on privlock, get lxclock after freer() drops it, then see
 *    numthreads is 0 and exit without touching lxclock again..
 * 3. freer has not yet locked privlock.  If get()er runs first, then put()er
 *    will see --numthreads = 1 and not call lxc_container_free().
*/

Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
Acked-by: Seth Arnold <seth.arnold@canonical.com>
Acked-by: Stéphane Graber <stgraber@ubuntu.com>
11 years agopython: Fix memory management
Stéphane Graber [Thu, 11 Apr 2013 12:15:21 +0000 (14:15 +0200)]
python: Fix memory management

Signed-off-by: Stéphane Graber <stgraber@ubuntu.com>
11 years agoubuntu template: fix installation when LANG=C
Dwight Engen [Wed, 3 Apr 2013 18:43:15 +0000 (14:43 -0400)]
ubuntu template: fix installation when LANG=C

The ubuntu template will silently fail (because it is set -e) on
the locale-gen command when LANG=C

Signed-off-by: Dwight Engen <dwight.engen@oracle.com>
Acked-by: Serge E. Hallyn <serge.hallyn@ubuntu.com>
11 years agooracle template: install additional user specified pkgs
Dwight Engen [Wed, 3 Apr 2013 16:31:46 +0000 (12:31 -0400)]
oracle template: install additional user specified pkgs

Fix lxc-create to not word split template arguments. This makes
lxc-create -n ol -t oracle -- -r "at cronie wget" work since the argument
to -r will be passed as one arg instead of three.

Fix oracle template -u option to shift the correct amount.

Signed-off-by: Dwight Engen <dwight.engen@oracle.com>
Acked-by: Serge E. Hallyn <serge.hallyn@ubuntu.com>
11 years agolxc-start-ephemeral: fixed bug with wrong ssh option (-k instead of -i)
Wojciech Izykowski [Sat, 6 Apr 2013 14:33:00 +0000 (16:33 +0200)]
lxc-start-ephemeral: fixed bug with wrong ssh option (-k instead of -i)

Corrected ssh option for custom key (from -k to -i). Just see ssh
manpage for justification.

Signed-off-by: Wojciech Izykowski <wizykowski@gmail.com>
Acked-by: Serge E. Hallyn <serge.hallyn@ubuntu.com>
11 years agodebian template: set arch when dpkg doesn't exist on host
Dwight Engen [Wed, 3 Apr 2013 21:08:32 +0000 (17:08 -0400)]
debian template: set arch when dpkg doesn't exist on host

Signed-off-by: Dwight Engen <dwight.engen@oracle.com>
Acked-by: Serge E. Hallyn <serge.hallyn@ubuntu.com>
11 years agofix wait status in pid reuse case
Dwight Engen [Mon, 8 Apr 2013 16:45:23 +0000 (12:45 -0400)]
fix wait status in pid reuse case

Commit 37c3dfc9 sets the wait status on only the child pid. It
intended to match the pid only once to protect against pid reuse but it
won't because the indicator was reset to 0 every time at the top of the
loop. If the child pid is reused, the wait status will be set again.
Fix by setting indicator outside the loop.

Signed-off-by: Dwight Engen <dwight.engen@oracle.com>
Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
11 years agominor documentation fixes / clarification
Dwight Engen [Tue, 9 Apr 2013 13:41:15 +0000 (09:41 -0400)]
minor documentation fixes / clarification

Signed-off-by: Dwight Engen <dwight.engen@oracle.com>
Acked-by: Serge E. Hallyn <serge.hallyn@ubuntu.com>
Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
11 years agoremove unused lxc_copy_file
Dwight Engen [Wed, 10 Apr 2013 14:49:51 +0000 (10:49 -0400)]
remove unused lxc_copy_file

Commit e3642c43 added lxc_copy_file for use in 64e1ae63. The use of it
was removed in commit 1bc60a65. Removing it reduces dead code and the
footprint of liblxc.

Signed-off-by: Dwight Engen <dwight.engen@oracle.com>
Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
11 years agolxc.functions: don't let LXC_PATH= line end in failure
Serge Hallyn [Tue, 9 Apr 2013 21:23:05 +0000 (16:23 -0500)]
lxc.functions: don't let LXC_PATH= line end in failure

Otherwise if called from dash with set -e, dash will exit.  This
causes lxc-clone to fail.

Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>