This separates out the DeviceSet logic a bit better from the raw
device mapper operations.
devicemapper: Serialize addess to the devicemapper deviceset
This code is not safe to run in multiple threads at the same time,
and neither is libdevmapper.
DeviceMapper: Move deactivate into UnmountDevice
This way the deactivate is atomic wrt othe device mapper operations
and will not fail with EBUSY if someone else starts a devicemapper
operation inbetween unmount and deactivate.
devmapper: Fix loopback mounting regression
Some changes were added to attach_loop_device which added
a perror() in a place that caused it to override errno so that
a later errno != EBUSY failed. This fixes that and cleans up
the error reporting a bit.
devmapper: Build on old kernels without LOOP_CTL_GET_FREE define
Upstream-commit: c77697a45ca615f66351a7363e93c3903e92553f
Component: engine
This is a better fix for futimes() on kernels not supporting O_PATH.
The previous fix broke when copying a device, as it tried to open it
and got and error.
Upstream-commit: 75e958bf48a83de5f3f80859aee96f3356d16d4b
Component: engine
There is no need to keep the image device around if we were the
onces creating the device.
Upstream-commit: 6c7ae06435d6e288024691f1133d7a2a24fd8ef3
Component: engine
Older kernel can't handle O_PATH in open() so this will
fail on dirs and symlinks. For dirs wa can fallback to
the normal Utimes, but for symlinks there is not much to do
but ignore their timestamps.
Upstream-commit: ed658156133862b3f181c9d3061be24b91435095
Component: engine
This creates a container by copying the corresponding files
from the layers into the containers. This is not gonna be very useful
on a developer setup, as there is no copy-on-write or general diskspace
sharing. It also makes container instantiation slower.
However, it may be useful in deployment where we don't always have a lot
of containers running (long-running daemons) and where we don't
do a lot of docker commits.
Upstream-commit: adae6849871fad0d74945fa1731712ea784e9a88
Component: engine
There are some changes here that make the file metadata better match
the layer files:
* Set the mode of the file after the chown, as otherwise the per-group/uid
specific flags and e.g. sticky bit is lost
* Use lchown instead of chown
* Delay mtime updates to after all other changes so that later file
creation doesn't change the mtime for the parent directory
* Use Futimes in combination with O_PATH|O_NOFOLLOW to set mtime on symlinks
Upstream-commit: 99c7d129f422b488f478bc7887f37003dacc83e6
Component: engine
The init layer needs to be topmost to make sure certain files
are always there (for instance, the ubuntu:12.10 image wrongly
has /dev/shm being a symlink to /run/shm, and we need to override
that). However, previously the devmapper code implemented the
init layer by putting it in the base devmapper device, which meant
layers above it could override these files (so that ubuntu:12.10
broke).
So, instead we put the base layer in *each* images devmapper device.
This is "safe" because we still have the pristine layer data
in the layer directory. Also, it means we diff the container
against the image with the init layer applied, so it won't show
up in diffs/commits.
Upstream-commit: c199ed228baf0e5d33b7739cc2442a32dece7020
Component: engine
Right now this does nothing but add a new layer, but it means
that all DeviceMounts are paired with DeviceUnmounts so that we
can track (and cleanup) active mounts.
Upstream-commit: 251a7ed437c17ecb66d33782f0b42633033198dd
Component: engine
This removes some Debugf() calls and chages some direct prints to
Debugf(). This means we don't get a bunch of spew when running the
tests.
Upstream-commit: bc7fa7b95773d638754eb72e7921ac328acb2ad6
Component: engine
To do diffing we just compare file metadata, so this relies
on things like size and mtime/ctime to catch any changes.
Its *possible* to trick this by updating a file without
changing the size and setting back the mtime/ctime, but
that seems pretty unlikely to happen in reality, and lets
us avoid comparing the actual file data.
Upstream-commit: 8e8ef7cb5b208ac657af812ebc5ffa783664cf3b
Component: engine
Without this there is really no way to map back from the device-mapper
devices to the actual docker image/container ids in case the json file
somehow got lost
Upstream-commit: b125f2334c7b68f624ee1eee06cb9d68922d0314
Component: engine
There is no need to keep all the device-mapper devices active, we
can just activate them on demand if needed.
Upstream-commit: a89a51128ecdf2db02a333a406752416de8a1db6
Component: engine
This supports creating images from layers and mounting them
for running a container.
Not supported yet are:
* Creating diffs between images/containers
* Creating layers for new images from a device-mapper container
Upstream-commit: fcd41fe51ae0418d583f3d33dfac7fc0879ca30e
Component: engine
We will later need the runtime to get access to the VolumeSet
singleton, and the container id to have a name for the volume
for the container
Upstream-commit: 8637ba710e8bd10ee36aa5c71f5ef54ab9037dfa
Component: engine