On Thu, Apr 24, 2008 at 10:14:49PM +0100, Daniel P. Berrange wrote:
On Thu, Apr 24, 2008 at 10:42:34PM +0200, Jim Meyering wrote:
> All of the virBufferAddLit and virBufferVSprintf calls
> above can fail with ENOMEM. I see that there are *many* more
> virBufferAddLit and virBufferVSprintf calls that ignore their
> return values (over 300), so maybe I'm missing something.
Yes, the entire set of Xen drivers is basically fubar wrt to checking
virBufferXXX return values. I felt that needed addresing independantly
changing everything in one go, so didn't try to address that in this
patch.
Maybe the best is to store in the buffer the fact that there have been
an error at some point, and check that value before extracting the content
in a single place, that would make the code cleaner, and makes harder to
miss one test.
Daniel
--
Red Hat Virtualization group
http://redhat.com/virtualization/
Daniel Veillard | virtualization library
http://libvirt.org/
veillard(a)redhat.com | libxml GNOME XML XSLT toolkit
http://xmlsoft.org/
http://veillard.com/ | Rpmfind RPM search engine
http://rpmfind.net/