[libvirt] [PATCH 5/7] lxc: controller: Improve container error reporting

Eric Blake eblake at redhat.com
Thu Jun 2 20:21:50 UTC 2011


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 at 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 at redhat.com    +1-801-349-2682
Libvirt virtualization library http://libvirt.org

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 619 bytes
Desc: OpenPGP digital signature
URL: <http://listman.redhat.com/archives/libvir-list/attachments/20110602/12657850/attachment-0001.sig>


More information about the libvir-list mailing list