[Libvir] [PATCH] Guard a negative value of "virsh setmem" and "virsh setmexmem"

Daniel Veillard veillard at redhat.com
Mon Mar 19 09:52:14 UTC 2007


On Mon, Mar 19, 2007 at 09:48:03AM +0900, Masayuki Sunou wrote:
> Hi Daniel
> 
> > This kind of errors must be caught when calling the API, if one casts 
> > from a signed to the unsigned long a check must be done at that point
> > for negative value by the caller. I'm unsure in what environment you
> > got the problem, but that's not the right way to fix it :-)
> > 
> This patch intends to add a check of the "bytes" value on virsh.

  Right, this makes sense, we need to add the check too in the python accessor
but that's generated code (libvirt_virDomainSetMemory in libvirt-py.c) so
I will keep this as a TODO, until we desactivate the automatic bindings
generation (or I find a good way to automatically patch the generated bindings
when the generator is run).
  Applied and commited to CVS,

  thanks a lot !

Daniel

-- 
Red Hat Virtualization group http://redhat.com/virtualization/
Daniel Veillard      | virtualization library  http://libvirt.org/
veillard at redhat.com  | libxml GNOME XML XSLT toolkit  http://xmlsoft.org/
http://veillard.com/ | Rpmfind RPM search engine  http://rpmfind.net/




More information about the libvir-list mailing list