On 03/30/2012 08:36 PM, Zhou Peng wrote: > Thanks for your patch serials. > I think they fix the true bug. > > But I have a little doubt on the fuzz allowance, pls have a see > comment in line below. > >> if (def->mem.cur_balloon > def->mem.max_balloon) { >> - virDomainReportError(VIR_ERR_XML_ERROR, >> - _("current memory '%lluk' exceeds maximum '%lluk'"), >> - def->mem.cur_balloon, def->mem.max_balloon); >> - goto error; >> + /* Older libvirt could get into this situation due to > Do you mean to allow the scene: > * The checkpoint( thought invalid by old libvirt) produced by older libvirt > can be thought valid if restored by the patched newer libvirt? Yes. It is indeed possible to have an older libvirt produce XML where the maximum memory was less than a megabyte boundary, and the current memory is anywhere between that maximum and the actual megabyte boundary. > But it will also allow a typo xml. Yes, but in practice, it won't make a difference, since it will only allow a typo if the difference falls in the rounding error up to the megabyte boundary. > * Another scene may be live migration between old libvirt > and newer libvirt (pls correct me if err) Yes, that is another situation where old libvirt xml can be output where cur is greater than max, but only by at most the difference due to rounding up to the megabyte boundary. > > If so, I think these scene should be documented or commented here or > in the commit msg explicitly, otherwise this piece of code may confuse many > readers, because I don't think cur_balloon can exceed max_balloon > again after patched > (so if exceed must be typo xml). I thought I did document and comment that, but I can add more words since both you and Osier seemed to be confused. v2 coming up. -- Eric Blake eblake@xxxxxxxxxx +1-919-301-3266 Libvirt virtualization library http://libvirt.org
Attachment:
signature.asc
Description: OpenPGP digital signature
-- libvir-list mailing list libvir-list@xxxxxxxxxx https://www.redhat.com/mailman/listinfo/libvir-list