Add pkg/libvirt

This is a small wrapper around libvirt, which will be used by the
libvirt exec driver. This is extracted for two reasons:

1) Move all the C-specific types and unsafe use out of the driver.

2) Having this in a separate submodule means the dependency on the
   libvirt library will only be pulled into the main docker binary,
   not dockerinit. This is not possible if the 'import "C"' code
   is part of the libvirt exec driver, *even* if that file is excluded
   from the build.

Docker-DCO-1.1-Signed-off-by: Alexander Larsson <alexl@redhat.com> (github: alexlarsson)
Docker-DCO-1.1-Signed-off-by: Josh Poimboeuf <jpoimboe@redhat.com> (github: jpoimboe)
libvirt network driver

Docker-DCO-1.1-Signed-off-by: Josh Poimboeuf <jpoimboe@redhat.com> (github: jpoimboe)
Add pkg/rpcfd

This is a small unix-domain-sockets only wrapper around net/rpc
that adds support for passing file descriptors in rpc messages.

Docker-DCO-1.1-Signed-off-by: Alexander Larsson <alexl@redhat.com> (github: alexlarsson)
Docker-DCO-1.1-Signed-off-by: Josh Poimboeuf <jpoimboe@redhat.com> (github: jpoimboe)
Add .dockersocket directory to init layer

This will be used by the libvirt exec driver to mount in a directory
with the rpc socket, allowing the daemon to interact with the dockerinit

Docker-DCO-1.1-Signed-off-by: Alexander Larsson <alexl@redhat.com> (github: alexlarsson)
Docker-DCO-1.1-Signed-off-by: Josh Poimboeuf <jpoimboe@redhat.com> (github: jpoimboe)
pkg/cgroups: Export ParseCgroupFile

This is needed for the libvirt exec driver.

Docker-DCO-1.1-Signed-off-by: Alexander Larsson <alexl@redhat.com> (github: alexlarsson)
Docker-DCO-1.1-Signed-off-by: Josh Poimboeuf <jpoimboe@redhat.com> (github: jpoimboe)
make TestEnv work with libvirt

Docker-DCO-1.1-Signed-off-by: Josh Poimboeuf <jpoimboe@redhat.com> (github: jpoimboe)
move ptySlave.Close() to execdrivers

As required by the current execdriver interface, libvirt uses two pty
pairs: one allocated by docker, and one allocated by dockerinit.  The
libvirt driver needs to keep docker's ptySlave open so that it can be
copied to/from the dockerinit ptyMaster.

This is most likely just a temporary solution.  Only a single pty pair
is really needed, but it will require more invasive interface changes.

Docker-DCO-1.1-Signed-off-by: Josh Poimboeuf <jpoimboe@redhat.com> (github: jpoimboe)
add exitCode to Restore() callback

Allow Restore() to return the exitCode, since libvirt can fully
reconnect to the long-running dockerinit and monitor the process even
after a dockerd restart.

Docker-DCO-1.1-Signed-off-by: Josh Poimboeuf <jpoimboe@redhat.com> (github: jpoimboe)
dockerinit: support tty and openstdin args

Add support for passing tty and openstdin args to dockerinit.  The
long-running dockerinit needs these to know how to setup the console
properly.

This is probably a temporary solution as these can eventually be passed
via RPC.

Docker-DCO-1.1-Signed-off-by: Josh Poimboeuf <jpoimboe@redhat.com> (github: jpoimboe)
libvirt execdriver

Docker-DCO-1.1-Signed-off-by: Josh Poimboeuf <jpoimboe@redhat.com> (github: jpoimboe)
Docker-DCO-1.1-Signed-off-by: Alexander Larsson <alexl@redhat.com> (github: alexlarsson)