On 06/02/2011 01:40 PM, Cole Robinson wrote:
Add a handshake with the cloned container process to try and detect
if it fails to start.
Signed-off-by: Cole Robinson <crobinso(a)redhat.com>
---
src/lxc/lxc_container.c | 18 ++++++++++++++----
src/lxc/lxc_container.h | 1 +
src/lxc/lxc_controller.c | 17 +++++++++++++++++
3 files changed, 32 insertions(+), 4 deletions(-)
Interesting - pipe() in the last patch, and socketpair() in this patch.
At any rate, the underlying use of the fd pair is the same.
ACK, post-release.
@@ -630,6 +631,12 @@ lxcControllerRun(virDomainDefPtr def,
goto cleanup;
}
+ if (socketpair(PF_UNIX, SOCK_STREAM, 0, containerhandshake) < 0) {
+ virReportSystemError(errno, "%s",
+ _("socketpair failed"));
+ goto cleanup;
+ }
+
root = virDomainGetRootFilesystem(def);
--
Eric Blake eblake(a)redhat.com +1-801-349-2682
Libvirt virtualization library
http://libvirt.org