
On Thu, Jul 18, 2013 at 10:43:59AM +0200, Michal Privoznik wrote:
On 12.07.2013 17:38, Daniel P. Berrange wrote:
From: "Daniel P. Berrange" <berrange@redhat.com>
Wire up the new virDomainCreate{XML}WithFiles methods in the LXC driver, so that FDs get passed down to the init process.
The lxc_container code needs to do a little dance in order to renumber the file descriptors it receives into linear order, starting from STDERR_FILENO + 1.
Signed-off-by: Daniel P. Berrange <berrange@redhat.com> --- src/lxc/lxc_container.c | 136 +++++++++++++++++++++++++++++++++++++---------- src/lxc/lxc_container.h | 6 ++- src/lxc/lxc_controller.c | 36 +++++++++++-- src/lxc/lxc_driver.c | 45 +++++++++++++--- src/lxc/lxc_process.c | 16 +++++- src/lxc/lxc_process.h | 1 + 6 files changed, 197 insertions(+), 43 deletions(-)
@@ -853,6 +856,12 @@ virLXCProcessBuildControllerCmd(virLXCDriverPtr driver, virCommandPreserveFD(cmd, ttyFDs[i]); }
+ for (i = 0; i < nfiles; i++) { + virCommandAddArg(cmd, "--passfd"); + virCommandAddArgFormat(cmd, "%d", files[i]); + virCommandPreserveFD(cmd, files[i], 0);
How does this even compile? s/, 0//
Sigh, I re-ordered the patches - what is #6 in this series used to be #3. Guess I didn't test the intermediate compile state of each patch after doing the re-ordering. Daniel -- |: http://berrange.com -o- http://www.flickr.com/photos/dberrange/ :| |: http://libvirt.org -o- http://virt-manager.org :| |: http://autobuild.org -o- http://search.cpan.org/~danberr/ :| |: http://entangle-photo.org -o- http://live.gnome.org/gtk-vnc :|