When running the test inside a docker container we sometimes are left with
leftover device nodes for device mapper devices that no longer exist.
We were panic:ing in this case, but with this change we just remove such
nodes.
Upstream-commit: 7b58e15b08349dba35bf3813f77a0b900c2e4df5
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: 55e1782d6623b59af3f1aea1eb9646a36bbb5579
Component: engine
Column 4 is the mount position, column 3 will not always be
"/" for the root. On one of my system its "/root".
Upstream-commit: 0484b2c3254238a6c534f7d417c12c10b694f0d0
Component: engine
There is no need to keep the image device around if we were the
onces creating the device.
Upstream-commit: 071cc18b58408eaa71575e0233a056475196b199
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: 2c71710b74829787a0c78f7e02f45d31935a996f
Component: engine
Typo in the loop-control code made it always fall back to the
old method of opening loopback devices.
Upstream-commit: bbc72c85f7733fefda499cb0e96f1dda2ce90625
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: 43a7d3d0e9e2fafcdc90cb84855e1bb3869d2729
Component: engine
This calculates the difference between a set of layers and a
directory tree.
Upstream-commit: 60f552cac3d165dbe4c8d65c1ab82d31700dcc5d
Component: engine
Change the comparison to better handle files that are copied during
container creation but not actually changed:
* Inode - this will change during a copy
* ctime - this will change during a copy (as we can't set it back)
* blocksize - this will change for sparse files during copy
* size for directories - this can change anytime but doesn't
necessarily reflect an actual contents change
* Compare mtimes at microsecond precision (as this is what utimes has)
Upstream-commit: ad402763e160ded1924c9b154983d81614e90deb
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: 5d2ace3424516bd7cc8d4a57fcaddd00fa1c4b5d
Component: engine
Rather than scan the files in the old directory twice to detect the
deletions we now scan both directories twice and then do all the
diffing on the in-memory structure.
This is more efficient, but it also lets us diff more complex things
later that are not exact on-disk trees.
Upstream-commit: 727e7fcccadf1d3e286f5a3c8d1aa388f6b4dab8
Component: engine
This happened for me on the last (empty) line, but better safe than sorry
so we make the check general.
Upstream-commit: 7d566b4f761e8942cf9679e96774b320b8496b2f
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: fdbc2695fe00d522c5c1a962f9be2f802bf53943
Component: engine
lxc-start requires / to be mounted private, otherwise the changes
it does inside the container (both mounts and unmounts) will propagate
out to the host.
We work around this by starting up lxc-start in its own namespace where
we set / to rprivate.
Unfortunately go can't really execute any code between clone and exec,
so we can't do this in a nice way. Instead we have a horrible hack that
use the unshare command, the shell and the mount command...
Upstream-commit: 429587779a95a4d38ec9cd66202de9729c320ef8
Component: engine
We can't look for the created file in the rwpath, because that
doesn't exist in the device-mapper world, instead look in the
RootfsPath.
Upstream-commit: 07227866006ea75a0c492814b808fdbb672431ee
Component: engine
We unmount all mounts and deactivate all device mapper devices to
make sure we're left with no leftovers after the test.
Upstream-commit: ed741f7b27b1b1cf5b6f8917551ce86bc39e9c78
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: 9e64ebb29549db19a84b8cb514bea60c26184779
Component: engine
This directory is copied to each test prefix which is really
slow with the large loopback mounts.
Upstream-commit: 7fb60caa5d34f8fc0abeae2ce7841000665414b0
Component: engine
I currently need this to get the tests running, otherwise it will
mount the docker.test binary inside the containers, which doesn't
work due to the libdevmapper.so dependency.
Upstream-commit: 76a2ab6e34e6cdd66899815aeeaac2048e5bafce
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: 6094257b28f2e4b5e1a6616c77961b5cec0c9195
Component: engine
We wrap the "real" DeviceSet for each test so that we get only
a single device-mapper pool and loopback mounts, but still
separate out the IDs in the tests. This makes the test run
much faster.
Upstream-commit: 52294192b2a008b624862701cbf8491ad19b0798
Component: engine
This wraps an existing DeviceSet and just adds a prefix to all ids in
it. This will be useful for reusing a single DeviceSet for all the tests
(but with separate ids)
Upstream-commit: 381ce94ef4fe2590b0afa16c5f35a508de12e7a3
Component: engine
If an image is deleted and there is a corresponding device
for that image we also delete the image.
Upstream-commit: 99393cf3cfd08de769f0c37f06b912fb3771a080
Component: engine
There are a few changes:
* Callers can specify if they want recursive behaviour or not
* All file listings to tar are sent on stdin, to handle long lists better
* We can pass in a list of filenames which will be created as empty
files in the tarball
This is exactly what we want for the creation of layer tarballs given
a container fs, a set of files to add and a set of whiteout files to create.
Upstream-commit: fda6ff9c2707efbd1c9d1f2bf151b9d1d082d0c6
Component: engine