On 03/04/2013 07:08 AM, Peter Krempa wrote:
This patch adds proper error reporting if parsing of cputune
parameters
fails due to incorrect values provided by the user. Previously no errors
were reported in such a case and the failure was silently ignored.
---
v2: report errors instead of ignoring them
-
- if ((n = virXPathNodeSet("./cputune/vcpupin", ctxt, &nodes)) < 0)
{
+ &def->cputune.emulator_quota) < -1) {
+ virReportError(VIR_ERR_XML_ERROR, "%s",
+ _("can't parse cputune emualtor quota value"));
s/emualtor/emulator/
ACK with that fixed, and seems safe enough for 1.0.3 if you see this in
time. I had to go researching why you only printed errors for < -1; but
I confirm that in util/virxml.c, the function is documented as returning
-1 for not present, -2 for present but parse error; and as these fields
are optional, not present does not mean an error.
--
Eric Blake eblake redhat com +1-919-301-3266
Libvirt virtualization library
http://libvirt.org