Archive: Fix up tar commandline arguments in TarFilter()

There is no need to duplicate the compression flags for
every element in the filter.
Make TarFilter more useful

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.
Implement container.ExportRW() on device-mapper
Runtime: Delete corresponding devices when deleting container
Delete corresponding Devices when deleting Images

If an image is deleted and there is a corresponding device
for that image we also delete the image.
Add DeviceSetWrapper

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)
Reuse a single DeviceSetDM for all the tests

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.
Limit the amount of prints during normal runs

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.
Allow specifying the docker client path in _DOCKER_INIT_PATH

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.
tests: Store the loopback images for test outside unit-tests

This directory is copied to each test prefix which is really
slow with the large loopback mounts.
Always start tests from a clean set of loopback images

This way we don't get any issues with leftovers
DeviceSet: Add UnmountDevice()

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.
deviceset: Cleanup device sets on test end

We unmount all mounts and deactivate all device mapper devices to
make sure we're left with no leftovers after the test.
graph test: Unmount image via image.Unmount()

This helps us track the unmount
Runtime: Only remove device on destroy if it exists
api_test: Fix PostContainersCreate

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.
Container: Inject into the mount, not the rwPath

For device-mapper setups we can't just push the file into the rwPath.
Utils: Add ShellQuoteArguments
lxc: Work around lxc-start need for private mounts

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...
devmapper: Move init layer to top rather than bottom

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.