]> git.proxmox.com Git - mirror_lxc.git/commit - src/lxc/lxccontainer.h
Move container creation fully into the api
authorSerge Hallyn <serge.hallyn@ubuntu.com>
Fri, 17 May 2013 21:23:17 +0000 (23:23 +0200)
committerSerge Hallyn <serge.hallyn@ubuntu.com>
Sun, 26 May 2013 00:27:07 +0000 (19:27 -0500)
commit1897e3bcd36af9f3fe6d3649910a9adb93e5e988
tree657d4a5fb98b15b5616b65ffca8e544f2a537ce0
parent60bf62d4ae36a48342fb8aee680fbd4b423810b1
Move container creation fully into the api

1. implement bdev->create:

python and lua: send NULL for bdevtype and bdevspecs.
They'll want to be updated to pass those in in a way that makes
sense, but I can't think about that right now.

2. templates: pass --rootfs

If the container is backed by a device which must be mounted (i.e.
lvm) then pass the actual rootfs mount destination to the
templates.

Note that the lxc.rootfs can be a mounted block device.  The template
should actually be installing the rootfs under the path where the
lxc.rootfs is *mounted*.

Still, some people like to run templates by hand and assume purely
directory backed containers, so continue to support that use case
(i.e. if no --rootfs is listed).

Make sure the templates don't re-write lxc.rootfs if it is
already in the config.  (Most were already checking for that)

3. Replace lxc-create script with lxc_create.c program.

Changelog:
May 24: when creating a container, create $lxcpath/$name/partial,
and flock it.  When done, close that file and unlink it.  In
lxc_container_new() and lxcapi_start(), check for this file.  If
it is locked, create is ongoing.  If it exists but is not locked,
create() was killed - remove the container.

May 24: dont disk-lock during lxcapi_create.  The partial lock
is sufficient.

Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
26 files changed:
configure.ac
src/lua-lxc/core.c
src/lxc/Makefile.am
src/lxc/arguments.h
src/lxc/bdev.c
src/lxc/bdev.h
src/lxc/lxc_create.c [new file with mode: 0644]
src/lxc/lxccontainer.c
src/lxc/lxccontainer.h
src/python-lxc/lxc.c
src/tests/cgpath.c
src/tests/clonetest.c
src/tests/createtest.c
src/tests/get_item.c
src/tests/shutdowntest.c
templates/lxc-alpine.in
templates/lxc-altlinux.in
templates/lxc-archlinux.in
templates/lxc-busybox.in
templates/lxc-debian.in
templates/lxc-fedora.in
templates/lxc-opensuse.in
templates/lxc-oracle.in
templates/lxc-sshd.in
templates/lxc-ubuntu-cloud.in
templates/lxc-ubuntu.in