[libvirt] [PATCH] Fix sexpr2string() to handle empty list

Jim Fehlig jfehlig at novell.com
Wed Aug 26 17:39:54 UTC 2009


Finally have some time to submit this small patch for a bug I'm seeing
with Xen 3.3.1.

If s-expression returned by xend contains an empty list, sexpr2string()
failed to serialize it.  E.g. sexpr containing (cpus (()())) would cause
sexpr2string() to fail.

I spoke with danpb on IRC about this bug and he suggested adding a
XML/sexpr pair that exhibits the problem to tests/xml2sexprtest.c.  I
can easily produce the sexpr but not the case with XML.  The empty cpus
lists indicate no explicit affinity and AFAIK the only way to express
this in XML is absence of cpuset attribute in vcpu element.  But IMO we
should not produce the (cpus (()()...)) sexpr in this case.  It should
only be produced when user has explicitly specified affinity.  Does this
sound reasonable?

Regards,
Jim

-------------- next part --------------
A non-text attachment was scrubbed...
Name: sexpr2string.patch
Type: text/x-diff
Size: 958 bytes
Desc: not available
URL: <http://listman.redhat.com/archives/libvir-list/attachments/20090826/67a82aed/attachment-0001.bin>


More information about the libvir-list mailing list