From: Ian Jackson Subject: Re: [PATCH 03/13] libxl: add libxl__xs_path_cleanup Date: Fri, 18 May 2012 17:06:28 +0100 Message-ID: <20406.29572.805586.170966@mariner.uk.xensource.com> References: <1337184716-49276-1-git-send-email-roger.pau@citrix.com> <1337184716-49276-4-git-send-email-roger.pau@citrix.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <1337184716-49276-4-git-send-email-roger.pau@citrix.com> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: Roger Pau Monne Cc: "xen-devel@lists.xen.org" List-Id: xen-devel@lists.xenproject.org Roger Pau Monne writes ("[PATCH 03/13] libxl: add libxl__xs_path_cleanup"): > Add a function which behaves like "xenstore-rm -t", and which will be > used to clean xenstore after unplug since we will be no longer > executing xen-hotplug-cleanup script, that used to do that for us. ... > + if (!user_path) { > + LOGE(ERROR, "null path provided"); > + return ERROR_INVAL; > + } What is this for ? Why not just crash ? > + if (!t) { > + LOGE(ERROR, "null transaction provided"); > + return ERROR_INVAL; > + } Likewise why not assert(t); ? > + path = libxl__strdup(gc, user_path); > + if (!xs_rm(CTX->xsh, t, path)) { > + rc = ERROR_FAIL; > + goto out; ... > +out: > + return rc; This has the effect of discarding the errno value if anything fails. Perhaps this function should log on all errors ? Ian.