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

Re: [Xen-devel] [PATCH] tools/libxl: Fix build following c/s c3c8da9



Andrew Cooper writes ("Re: [PATCH] tools/libxl: Fix build following c/s 
c3c8da9"):
> On 29/06/15 15:09, Ian Jackson wrote:
> > Can you easily confirm that this fixes it ?
> 
> It does indeed.  Tested-by: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>
> 
> However, the problem with this style is that it is subverted by:
> 
> rc = libxl__datacopier_start(dc);
> if (rc) goto out;
> 
> out of context below, which cases rc to be initialised on all subsequent
> error paths, and thus miss further issues where it is set incorrectly.

Yes, I agree that this is less than ideal.  It means that not all such
uninitialised rc's will be found, but ...

> I would suggest introducing another int to hold the temporary from
> libxl__datacopier_start().

... this would be quite inconvenient.

The right answer IMO is to replace the idiom

   rc = some_function(...);
   if (rc) goto out;

with a macro invocation

   CHECKING_RC( some_function(...) );

and maybe have a `goto out' macro, too

   GOTO_OUT_RC(FAIL);

But I'm not sure my co-maintainers agree.

Anyway, thanks for the tested-by.  I will make a proper commit message
etc. and apply my patch.

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