WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-devel

[Xen-devel] [PATCH 17 of 24] libxl: add libxl__spawn_confirm_offspring_s

To: xen-devel@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-devel] [PATCH 17 of 24] libxl: add libxl__spawn_confirm_offspring_startup
From: Olaf Hering <olaf@xxxxxxxxx>
Date: Mon, 03 Oct 2011 17:54:54 +0200
Delivery-date: Mon, 03 Oct 2011 08:59:10 -0700
Dkim-signature: v=1; a=rsa-sha1; c=relaxed/relaxed; t=1317657285; l=1926; s=domk; d=aepfle.de; h=To:From:Date:References:In-Reply-To:Subject: Content-Transfer-Encoding:MIME-Version:Content-Type:X-RZG-CLASS-ID: X-RZG-AUTH; bh=hWGa2gz0R4z1CYy9ZnHbuzXwENo=; b=y/DCQvYVICyKZ5yHFt6VBLbY3Ks9sEbU4fM57VSxUGuyqGSyH4dhK1cgHm2mSn9U57W gmSYczYf8pHOnkngxMZzzrONf0XqrXoFQd4rGmGHT71nCNjrhAzzvpPJ9gdHd5cdWxNV3 AJ3t3bnaLwE974etlX+rCHaoXvGl+o4hzFI=
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
In-reply-to: <patchbomb.1317657277@xxxxxxxxxxxx>
List-help: <mailto:xen-devel-request@lists.xensource.com?subject=help>
List-id: Xen developer discussion <xen-devel.lists.xensource.com>
List-post: <mailto:xen-devel@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe>
References: <patchbomb.1317657277@xxxxxxxxxxxx>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
User-agent: Mercurial-patchbomb/1.7.5
# HG changeset patch
# User Olaf Hering <olaf@xxxxxxxxx>
# Date 1317653616 -7200
# Node ID 018f63b6e4863faca16a832a5a34c6a6e7726cf7
# Parent  35ec0355b3283a87477c7377a2fd3da5e84d2bcd
libxl: add libxl__spawn_confirm_offspring_startup

libxl__spawn_confirm_offspring_startup() is a generic version of
libxl__confirm_device_model_startup().

Signed-off-by: Olaf Hering <olaf@xxxxxxxxx>

diff -r 35ec0355b328 -r 018f63b6e486 tools/libxl/libxl_exec.c
--- a/tools/libxl/libxl_exec.c
+++ b/tools/libxl/libxl_exec.c
@@ -262,6 +262,30 @@ err:
     return -1;
 }
 
+static int detach_offspring(libxl__gc *gc,
+                               libxl__spawner_starting *starting)
+{
+    int rc;
+    rc = libxl__spawn_detach(gc, starting->for_spawn);
+    if (starting->for_spawn)
+        free(starting->for_spawn);
+    free(starting);
+    return rc;
+}
+
+int libxl__spawn_confirm_offspring_startup(libxl__gc *gc,
+                                       uint32_t timeout, char *what,
+                                       char *path, char *state,
+                                       libxl__spawner_starting *starting)
+{
+    int detach;
+    int problem = libxl__wait_for_offspring(gc, starting->domid, timeout, what,
+                                               path, state,
+                                               starting->for_spawn, NULL, 
NULL);
+    detach = detach_offspring(gc, starting);
+    return problem ? problem : detach;
+}
+
 static int libxl__set_fd_flag(libxl__gc *gc, int fd, int flag)
 {
     int flags;
diff -r 35ec0355b328 -r 018f63b6e486 tools/libxl/libxl_internal.h
--- a/tools/libxl/libxl_internal.h
+++ b/tools/libxl/libxl_internal.h
@@ -313,6 +313,12 @@ _hidden int libxl__wait_for_offspring(li
                                                        const char *state,
                                                        void *userdata),
                                  void *check_callback_userdata);
+
+_hidden int libxl__spawn_confirm_offspring_startup(libxl__gc *gc,
+                                       uint32_t timeout, char *what,
+                                       char *path, char *state,
+                                       libxl__spawner_starting *starting);
+
   /* Logs errors.  A copy of "what" is taken.  Return values:
    *  < 0   error, for_spawn need not be detached
    *   +1   caller is the parent, must call detach on *for_spawn eventually

_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel