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

Re: [Xen-devel] [PATCH 14 of 24] libxl: add pid path to libxl__spawner_s

To: Olaf Hering <olaf@xxxxxxxxx>
Subject: Re: [Xen-devel] [PATCH 14 of 24] libxl: add pid path to libxl__spawner_starting
From: Ian Campbell <Ian.Campbell@xxxxxxxxxx>
Date: Tue, 4 Oct 2011 09:23:19 +0100
Cc: "xen-devel@xxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxx>
Delivery-date: Tue, 04 Oct 2011 01:24:15 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
In-reply-to: <219ab93f22c049259568.1317657291@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>
Organization: Citrix Systems, Inc.
References: <patchbomb.1317657277@xxxxxxxxxxxx> <219ab93f22c049259568.1317657291@xxxxxxxxxxxx>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
On Mon, 2011-10-03 at 16:54 +0100, Olaf Hering wrote:
> # HG changeset patch
> # User Olaf Hering <olaf@xxxxxxxxx>
> # Date 1317653612 -7200
> # Node ID 219ab93f22c0492595686a1cc34911e9d6775b07
> # Parent  df7be429654c62fb4c61f83549374d77b80ebea3
> libxl: add pid path to libxl__spawner_starting
> 
> libxl_spawner_record_pid() should be able to write the pid to arbitrary paths.
> 
> Signed-off-by: Olaf Hering <olaf@xxxxxxxxx>
> 
> diff -r df7be429654c -r 219ab93f22c0 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 df7be429654c -r 219ab93f22c0 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 df7be429654c -r 219ab93f22c0 tools/libxl/libxl_internal.h
> --- a/tools/libxl/libxl_internal.h
> +++ b/tools/libxl/libxl_internal.h
> @@ -250,6 +250,7 @@ typedef struct {
>  
>  typedef struct {
>      char *dom_path; /* from libxl_malloc, only for libxl_spawner_record_pid 
> */
> +    char *pid_path; /* from libxl_malloc, only for libxl_spawner_record_pid 
> */

Either this new comment is true and you need a strdup() up above where
you set it and a free() somewhere else (or use libxl__strdup()) or it is
false and it should be removed and pid_path should be const char *.

I think the second option is sufficient for the current and new user you
are about to add?

Ian.

>      int domid;
>      libxl__spawn_starting *for_spawn;
>  } libxl__spawner_starting;
> 
> _______________________________________________
> Xen-devel mailing list
> Xen-devel@xxxxxxxxxxxxxxxxxxx
> http://lists.xensource.com/xen-devel



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

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