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 13 of 24] libxl: rename dm_xenstore_record_pid to lib

To: xen-devel@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-devel] [PATCH 13 of 24] libxl: rename dm_xenstore_record_pid to libxl_spawner_record_pid
From: Olaf Hering <olaf@xxxxxxxxx>
Date: Mon, 03 Oct 2011 17:54:50 +0200
Delivery-date: Mon, 03 Oct 2011 09:22:08 -0700
Dkim-signature: v=1; a=rsa-sha1; c=relaxed/relaxed; t=1317657300; l=3161; 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=jF+xKWMF9vYeCofNaGdjrUL+jBE=; b=opxOU1iWMvScwmv8pea3O/gU2upgxtKzu7Sk0c9GFzfMDhRyO61Z2OEOmcTcJcm9riR dEiNty/JVgnjWab5vkAepwFo+RxCMy2/HOX9B5j2iANg+8qRIJRJSJonlBbN6h6PepHlY CYcX+bjAsDQnZtO2JZfxndOXr1z98ywQQ/A=
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 1317653611 -7200
# Node ID df7be429654c62fb4c61f83549374d77b80ebea3
# Parent  ea8738e045595a235fc05384d3f4d7c74537cd0a
libxl: rename dm_xenstore_record_pid to libxl_spawner_record_pid

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

diff -r ea8738e04559 -r df7be429654c tools/libxl/libxl_dm.c
--- a/tools/libxl/libxl_dm.c
+++ b/tools/libxl/libxl_dm.c
@@ -516,31 +516,6 @@ static char ** libxl__build_device_model
     }
 }
 
-static void dm_xenstore_record_pid(void *for_spawn, pid_t innerchild)
-{
-    libxl__spawner_starting *starting = for_spawn;
-    struct xs_handle *xsh;
-    char *path = NULL, *pid = NULL;
-    int len;
-
-    if (asprintf(&path, "%s/%s", starting->dom_path, "image/device-model-pid") 
< 0)
-        goto out;
-
-    len = asprintf(&pid, "%d", innerchild);
-    if (len < 0)
-        goto out;
-
-    /* we mustn't use the parent's handle in the child */
-    xsh = xs_daemon_open();
-
-    xs_write(xsh, XBT_NULL, path, pid, len);
-
-    xs_daemon_close(xsh);
-out:
-    free(path);
-    free(pid);
-}
-
 static int libxl__vfb_and_vkb_from_device_model_info(libxl__gc *gc,
                                                      libxl_device_model_info 
*info,
                                                      libxl_device_vfb *vfb,
@@ -896,7 +871,7 @@ retry_transaction:
     }
 
     rc = libxl__spawn_spawn(gc, p->for_spawn, "device model",
-                            dm_xenstore_record_pid, p);
+                            libxl_spawner_record_pid, p);
     if (rc < 0)
         goto out_close;
     if (!rc) { /* inner child */
diff -r ea8738e04559 -r df7be429654c tools/libxl/libxl_exec.c
--- a/tools/libxl/libxl_exec.c
+++ b/tools/libxl/libxl_exec.c
@@ -144,6 +144,31 @@ void libxl_report_child_exitstatus(libxl
     }
 }
 
+void libxl_spawner_record_pid(void *for_spawn, pid_t innerchild)
+{
+    libxl__spawner_starting *starting = for_spawn;
+    struct xs_handle *xsh;
+    char *path = NULL, *pid = NULL;
+    int len;
+
+    if (asprintf(&path, "%s/%s", starting->dom_path, "image/device-model-pid") 
< 0)
+        goto out;
+
+    len = asprintf(&pid, "%d", innerchild);
+    if (len < 0)
+        goto out;
+
+    /* we mustn't use the parent's handle in the child */
+    xsh = xs_daemon_open();
+
+    xs_write(xsh, XBT_NULL, path, pid, len);
+
+    xs_daemon_close(xsh);
+out:
+    free(path);
+    free(pid);
+}
+
 static int libxl__set_fd_flag(libxl__gc *gc, int fd, int flag)
 {
     int flags;
diff -r ea8738e04559 -r df7be429654c tools/libxl/libxl_internal.h
--- a/tools/libxl/libxl_internal.h
+++ b/tools/libxl/libxl_internal.h
@@ -249,7 +249,7 @@ typedef struct {
 } libxl__spawn_starting;
 
 typedef struct {
-    char *dom_path; /* from libxl_malloc, only for dm_xenstore_record_pid */
+    char *dom_path; /* from libxl_malloc, only for libxl_spawner_record_pid */
     int domid;
     libxl__spawn_starting *for_spawn;
 } libxl__spawner_starting;
@@ -300,6 +300,8 @@ _hidden int libxl__spawn_spawn(libxl__gc
                       void *hook_data);
 _hidden int libxl__destroy_device_model(libxl__gc *gc, uint32_t domid);
 
+_hidden void libxl_spawner_record_pid(void *for_spawn, pid_t innerchild);
+
   /* 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

<Prev in Thread] Current Thread [Next in Thread>