[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Xen-devel] [PATCH] xenconsole: Ensure exclusive access to console using locks



On Friday, 24.07.2015 at 14:32, Ian Jackson wrote:
> > +static void console_lock(int domid)
> > +{
> > +   lockfile = malloc(PATH_MAX);
> > +   if (lockfile == NULL)
> > +           err(ENOMEM, "malloc");
> > +   snprintf(lockfile, PATH_MAX - 1, "%s/xenconsole.%d", XEN_LOCK_DIR, 
> > domid);
> 
> Why not use asprintf ?

asprintf is a GNU/BSD extension, not available on e.g. Solaris. Do we care
about that?

> You should use the same recipe as with-lock-ex (from chiark-utils)
> 
>   
> http://www.chiark.greenend.org.uk/ucgi/~ian/git?p=chiark-utils.git;a=blob;f=cprogs/with-lock-ex.c;h=1850d1f0283bd61fc1da12458cba7ec0a227c572;hb=HEAD
>   
> (which we also use in tools/hotplug/Linux/locking.sh and
> tools/libxl/libxl_internal.c:libxl__lock_domain_userdata)

Thanks for the pointers, I'll use that strategy.

Martin

_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxx
http://lists.xen.org/xen-devel


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.