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 2 of 7] libxl: rename dm_xenstore_record_pid to libxl

To: xen-devel@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-devel] [PATCH 2 of 7] libxl: rename dm_xenstore_record_pid to libxl_spawner_record_pid
From: Olaf Hering <olaf@xxxxxxxxx>
Date: Thu, 27 Oct 2011 12:03:14 +0200
Delivery-date: Thu, 27 Oct 2011 03:06:52 -0700
Dkim-signature: v=1; a=rsa-sha1; c=relaxed/relaxed; t=1319709799; 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=KNUnFRHdZqKYFRB5sooxyPhP/Ug=; b=eKf0BfYxQE2c9kvWHkLt/8W4s1mZ84NUAjhjgZwpSouOj2uNbEE7hOxhMerXf0bfTpz +NaJ3s/f/qbPDPT8N1X6Z1JLxCus8/DJioSt9EVa3Vyo4IfSWb5E4eZoAWQB2WRrvXo8M BLmKEDxI2mBjHHeTlA+hU6wuo4VWVE+Htv4=
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
In-reply-to: <patchbomb.1319709792@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.1319709792@xxxxxxxxxxxx>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
User-agent: Mercurial-patchbomb/1.7.5
# HG changeset patch
# User Olaf Hering <olaf@xxxxxxxxx>
# Date 1319707162 -7200
# Node ID 57af937278c5c00944bcaf245dd173e9345cdecc
# Parent  b709d7fefde93765b386204d9d56e2fe4e7a654f
libxl: rename dm_xenstore_record_pid to libxl_spawner_record_pid

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

diff -r b709d7fefde9 -r 57af937278c5 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 b709d7fefde9 -r 57af937278c5 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 b709d7fefde9 -r 57af937278c5 tools/libxl/libxl_internal.h
--- a/tools/libxl/libxl_internal.h
+++ b/tools/libxl/libxl_internal.h
@@ -276,7 +276,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;
@@ -327,6 +327,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