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 V4] libxl: make libxl communicate with xenstored

Ian Campbell writes ("RE: [Xen-devel] [PATCH V4] libxl: make libxl communicate 
with xenstored by socket or xenbus driver"):
> On Thu, 2010-09-16 at 20:21 +0100, Jun Zhu (Intern) wrote:
> > The functions, such as dm_xenstore_record_pid, do not have a ctx
> > pointer in its function parameters. In these functions, if they invoke
> > the libxl__xs_open, it does not have ctx pointer. Should we use the
> > extern ctx directly? I find only the functions in xl_cmdimpl.c use ctx
> > in this way, and the other functions under libxl get the ctx pointer
> > from its function parameter.  
> 
> Under no circumstances should libxl try and use a global ctx pointer
> from the application using libxl.
> 
> dm_xenstore_record_pid runs in a new process and therefore there is no
> existing context which can be used.

I think it is fine to to reuse the ctx from the caller in
dm_xenstore_record_pid.  Your "new process" test seems to imply
problems for any other daemonic processes libxl may need to spawn.

If the caller needs to know when libxl forks, we should provide a
callback function pointer in the ctx to allow the caller to be told.

Ian.

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