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

Re: [Xen-devel] [PATCH 1 of 3] libxl: add internal function to get a domain's scheduler



On Wed, 2012-05-23 at 20:47 +0100, George Dunlap wrote:
> On Wed, May 23, 2012 at 10:26 AM, Ian Campbell <ian.campbell@xxxxxxxxxx> 
> wrote:
> >         if (!tmp) {
> >             LIBXL__LOG_ERRNO(ctx, LIBXL__LOG_ERROR, "allocating cpupool 
> > info");
> > +            while(--i>0)
> > +                libxl_cpupoolinfo_dispose(ptr+i);
> 
> I'm not a fan of putting state-changes and conditionals in the same
> expression and relying on prefix/postifx precedence to sort things
> out.  It seems like it's laying a trap for some poor tired programmer
> in the future to make a thinko.  Would it really be that bad to just
> write "for(i--; i>0; i--)"? :-)
> 
> Actually -- walk me through this one.  Won't this fail to call
> libxl_cpupoolinfo_dispose() on element 0?

That's certainly not impossible! I'll double check as I rewrite it along
the lines you suggest.

> 
>  -G



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