[libvirt] [PATCHv2 03/13] virbuf: more detailed error reporting
Hai Dong Li
haidongl at linux.vnet.ibm.com
Tue Oct 18 05:45:31 UTC 2011
On 09/30/2011 12:22 AM, Eric Blake wrote:
> 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): Adjust callers.
> ---
> src/util/buf.c | 26 +++++++++++++-------------
> 1 files changed, 13 insertions(+), 13 deletions(-)
>
I checked this patch, it seems everything is all right.
More information about the libvir-list
mailing list