]> git.ipfire.org Git - thirdparty/libvirt.git/commit
Allow handshake with child process during startup
authorDaniel P. Berrange <berrange@redhat.com>
Mon, 22 Nov 2010 13:31:35 +0000 (13:31 +0000)
committerDaniel P. Berrange <berrange@redhat.com>
Thu, 2 Jun 2011 09:53:58 +0000 (10:53 +0100)
commit285c2fdf0ffa8effad0c2b27b862055be4791801
tree675c5110667580dab2385341a3682b983b593e3a
parentb598ac555c8fe67ffc39ac8ef25fe7e6b28ae3f2
Allow handshake with child process during startup

Allow the parent process to perform a bi-directional handshake
with the child process during fork/exec. The child process
will fork and do its initial setup. Immediately prior to the
exec(), it will stop & wait for a handshake from the parent
process. The parent process will spawn the child and wait
until the child reaches the handshake point. It will do
whatever extra setup work is required, before signalling the
child to continue.

The implementation of this is done using two pairs of blocking
pipes. The first pair is used to block the parent, until the
child writes a single byte. Then the second pair pair is used
to block the child, until the parent confirms with another
single byte.

* src/util/command.c, src/util/command.h,
  src/libvirt_private.syms: Add APIs to perform a handshake
src/libvirt_private.syms
src/util/command.c
src/util/command.h