]> git.ipfire.org Git - thirdparty/libvirt.git/commit
virbuf: more detailed error reporting
authorEric Blake <eblake@redhat.com>
Tue, 27 Sep 2011 19:37:23 +0000 (13:37 -0600)
committerEric Blake <eblake@redhat.com>
Thu, 20 Oct 2011 22:02:15 +0000 (16:02 -0600)
commit818a9665108368462aa46162e3182c167004323e
tree29728570d0d9b8f9855446562c222dbc33f4769c
parentef696300e63b3b9508b016823e15f4c8296cb85a
virbuf: more detailed error reporting

The next patch wants to add some sanity checking, which would
be a different error than ENOMEM.  Many existing callers blindly
report OOM failure if virBuf reports an error, and this will be
wrong in the (unlikely) case that they actually had a usage error
instead; but since the most common error really is ENOMEM, I'm
not going to fix all callers.  Meanwhile, new discriminating
callers can react differently depending on what failure happened.

* src/util/buf.c (virBufferSetError): Add parameter.
(virBufferGrow, virBufferVasprintf, virBufferEscapeString)
(virBufferEscapeSexpr, virBufferEscapeShell): Adjust callers.
src/util/buf.c