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

Re: [Xen-devel] [PATCH 07/15] libxl: provide libxl__xs_*_checked and libxl__xs_transaction_*



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.



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