From: Ian Campbell Subject: Re: [PATCH 07/15] libxl: provide libxl__xs_*_checked and libxl__xs_transaction_* Date: Thu, 31 May 2012 12:17:42 +0100 Message-ID: <1338463062.17466.10.camel@zakaz.uk.xensource.com> References: <1338394606-22693-1-git-send-email-ian.jackson@eu.citrix.com> <1338394606-22693-8-git-send-email-ian.jackson@eu.citrix.com> <1338400101.14877.24.camel@dagon.hellion.org.uk> <20423.18032.316476.341196@mariner.uk.xensource.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <20423.18032.316476.341196@mariner.uk.xensource.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: Ian Jackson Cc: "xen-devel@lists.xen.org" List-Id: xen-devel@lists.xenproject.org On Thu, 2012-05-31 at 11:22 +0100, Ian Jackson wrote: > Ian Campbell writes ("Re: [Xen-devel] [PATCH 07/15] libxl: provide libxl__xs_*_checked and libxl__xs_transaction_*"): > > > > > +int libxl__xs_read_checked(libxl__gc *gc, xs_transaction_t t, > > > + const char *path, const char **result_out) > > > +{ > > > + char *result = libxl__xs_read(gc, t, path); > > > + if (!result) { > > > + if (errno != ENOENT) { > > > > Can't you combine these with && ? > > Yes, but this matches better the way I think of it. I can change it > if you like. It's fine, your reason for writing it that way is as good as any. > > It would be much more useful if this function took a "const char > > *what" (even just __func__ from the caller) and logged it here. > > I think that this call can only fail due to general failure of > xenstore (or our xenstore handle). So a `what' here wouldn't help > much. The other helpers are more likely to fail (permissions, for > example) but they can log the path. [...] > So I think I would prefer to keep things as they are. Based on your argument I agree. Ian.