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

Re: [Xen-devel] Re: [PATCH 01/10] xen: Make all reserved pages for the balloon be INVALID_P2M_ENTRY.



On Tue, 2010-12-21 at 22:19 +0000, Jeremy Fitzhardinge wrote: 
> On 12/21/2010 01:37 PM, Konrad Rzeszutek Wilk wrote:
> > +           BUG_ON(!set_phys_to_machine(pfn, INVALID_P2M_ENTRY));
[...] 
> I'm not a fan of hiding real side-effectful code in a BUG_ON
> predicate.
> 
> > +           BUG_ON(get_phys_to_machine(pfn) != INVALID_P2M_ENTRY);

I'm also not a fan of this "is the previous I called function buggy"
BUG_ON.

If we aren't confident that set_phys_to_machine() is doing the right
thing then adding a post-condition check to that function would be a
more preferable option.

Ian.



_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.