Re: [PATCHv2] conf: Report errors on cputune parameter parsing

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

 



On 03/04/13 22:41, Eric Blake wrote:
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.

Thanks; pushed; unfortunately after the release.

Peter

--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list


[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]