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 3 of 7] libxl: add pid path to libxl__spawner_startin

To: xen-devel@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-devel] [PATCH 3 of 7] libxl: add pid path to libxl__spawner_starting
From: Olaf Hering <olaf@xxxxxxxxx>
Date: Thu, 27 Oct 2011 12:03:15 +0200
Delivery-date: Thu, 27 Oct 2011 03:04:36 -0700
Dkim-signature: v=1; a=rsa-sha1; c=relaxed/relaxed; t=1319709799; l=1667; 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=ec16y7r/zpICaXjzWjxFlu8LUjw=; b=GHerxJtxn0bP5KE2xXh1ciPAgb/nbd7WGF7z8IGOQCqpgm3TeEB/VY6EOwwm7OzTM3D GBWbkTnq/djbc1R4m/OuCe36v34SJVDJ03Lg1ls2b7wMrZIuwbSmi3jEKusyFp/f0JMqX rSXcrdQJm/ZPorWGvO9S9RHAhVad0/E+z38=
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 1319707225 -7200
# Node ID 1417042ea4ab7b43fed11535c6d79d88ded644dc
# Parent  57af937278c5c00944bcaf245dd173e9345cdecc
libxl: add pid path to libxl__spawner_starting

libxl_spawner_record_pid() should be able to write the pid to arbitrary paths.

v2:
 - use const char* for ->pid_path, and update comment

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

diff -r 57af937278c5 -r 1417042ea4ab tools/libxl/libxl_dm.c
--- a/tools/libxl/libxl_dm.c
+++ b/tools/libxl/libxl_dm.c
@@ -848,6 +848,7 @@ int libxl__create_device_model(libxl__gc
 
     p->domid = info->domid;
     p->dom_path = libxl__xs_get_dompath(gc, info->domid);
+    p->pid_path = "image/device-model-pid";
     if (!p->dom_path) {
         rc = ERROR_FAIL;
         goto out_close;
diff -r 57af937278c5 -r 1417042ea4ab tools/libxl/libxl_exec.c
--- a/tools/libxl/libxl_exec.c
+++ b/tools/libxl/libxl_exec.c
@@ -151,7 +151,7 @@ void libxl_spawner_record_pid(void *for_
     char *path = NULL, *pid = NULL;
     int len;
 
-    if (asprintf(&path, "%s/%s", starting->dom_path, "image/device-model-pid") 
< 0)
+    if (asprintf(&path, "%s/%s", starting->dom_path, starting->pid_path) < 0)
         goto out;
 
     len = asprintf(&pid, "%d", innerchild);
diff -r 57af937278c5 -r 1417042ea4ab tools/libxl/libxl_internal.h
--- a/tools/libxl/libxl_internal.h
+++ b/tools/libxl/libxl_internal.h
@@ -277,6 +277,7 @@ typedef struct {
 
 typedef struct {
     char *dom_path; /* from libxl_malloc, only for libxl_spawner_record_pid */
+    const char *pid_path; /* only for libxl_spawner_record_pid */
     int domid;
     libxl__spawn_starting *for_spawn;
 } libxl__spawner_starting;

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