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

Re: [Xen-devel] [RFC PATCH 2/6] libxl: stop using libxl__xs_mkdir() for ~/control/shutdown



> -----Original Message-----
> From: Ian Campbell [mailto:ian.campbell@xxxxxxxxxx]
> Sent: 25 November 2015 11:02
> To: Paul Durrant; Ian Jackson
> Cc: xen-devel@xxxxxxxxxxxxxxxxxxxx; Stefano Stabellini; Wei Liu
> Subject: Re: [RFC PATCH 2/6] libxl: stop using libxl__xs_mkdir() for
> ~/control/shutdown
> 
> On Wed, 2015-11-25 at 10:46 +0000, Paul Durrant wrote:
> > > Or maybe this is the behaviour of XS_MKDIR on a path/node which
> already
> > > exists?
> > >
> >
> > Yes, that's exactly it. I believe XS_MKDIR does guarantee to create a
> > path empty, but will not clear an existing one.
> 
> Thanks.
> 
> I suppose clearing a node on mkdir would be an equally surprising semantic,
> after all mkdir(1) doesn't remove all files in an existing directory.
> 
> It's a pity MKDIR doesn't follow mkdir(1) and return EEXIST, but we are
> stuck with that I guess.
> 
> As well as the changes being considered here I wonder if any
> libxl__xs_mkdir alike ought to include the existence check and error
> return?

Looking at the current callers of libxl__xs_mkdir(), I think they all expect to 
be creating new (empty) paths so I was planning a global replace of 
libxl__xs_mkdir() with libxl__xs_mknod() and I'll put a comment in the header 
to explain the semantics of that function.

  Paul

> 
> Ian.
_______________________________________________
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®.