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

Eric Blake eblake at redhat.com
Mon Mar 4 21:41:18 UTC 2013


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

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 621 bytes
Desc: OpenPGP digital signature
URL: <http://listman.redhat.com/archives/libvir-list/attachments/20130304/49b983ed/attachment-0001.sig>


More information about the libvir-list mailing list