From mboxrd@z Thu Jan 1 00:00:00 1970 From: Ian Campbell Subject: Re: [RFC PATCH 2/6] libxl: stop using libxl__xs_mkdir() for ~/control/shutdown Date: Wed, 25 Nov 2015 11:02:09 +0000 Message-ID: <1448449329.17688.64.camel@citrix.com> References: <1447258719-21891-1-git-send-email-paul.durrant@citrix.com> <1447258719-21891-3-git-send-email-paul.durrant@citrix.com> <22090.4182.47345.718602@mariner.uk.xensource.com> <9AAE0902D5BC7E449B7C8E4E778ABCD02F673A1F@AMSPEX01CL01.citrite.net> <22090.4808.733814.408085@mariner.uk.xensource.com> <9AAE0902D5BC7E449B7C8E4E778ABCD02F673B74@AMSPEX01CL01.citrite.net> <22100.37275.70733.869315@mariner.uk.xensource.com> <9AAE0902D5BC7E449B7C8E4E778ABCD02F69590A@AMSPEX01CL01.citrite.net> <1448448166.17688.47.camel@citrix.com> <9AAE0902D5BC7E449B7C8E4E778ABCD02F697254@AMSPEX01CL01.citrite.net> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from mail6.bemta14.messagelabs.com ([193.109.254.103]) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1a1Xqd-0008GG-UE for xen-devel@lists.xenproject.org; Wed, 25 Nov 2015 11:02:52 +0000 In-Reply-To: <9AAE0902D5BC7E449B7C8E4E778ABCD02F697254@AMSPEX01CL01.citrite.net> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: Paul Durrant , Ian Jackson Cc: "xen-devel@lists.xenproject.org" , Stefano Stabellini , Wei Liu List-Id: xen-devel@lists.xenproject.org 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? Ian.