qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH V2 3/6] libqblock error handling


From: Eric Blake
Subject: Re: [Qemu-devel] [PATCH V2 3/6] libqblock error handling
Date: Mon, 10 Sep 2012 15:33:19 -0600
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:15.0) Gecko/20120828 Thunderbird/15.0

On 09/10/2012 02:26 AM, Wenchao Xia wrote:
>   This patch contains error handling APIs, which user could call them to
> get error details.
> 
> Signed-off-by: Wenchao Xia <address@hidden>
> ---
>  libqblock/libqblock-error.c |   60 
> +++++++++++++++++++++++++++++++++++++++++++
>  libqblock/libqblock-error.h |   50 +++++++++++++++++++++++++++++++++++
>  2 files changed, 110 insertions(+), 0 deletions(-)
>  create mode 100644 libqblock/libqblock-error.c
>  create mode 100644 libqblock/libqblock-error.h

Again, this should come earlier in the series, and I'm focusing on the
.h as a potential user, rather than on the .c.

> +    default:
> +        err_ret_str = "Unknow error.";

s/Unknow/Unknown/

> +++ b/libqblock/libqblock-error.h
> +/**
> + * qb_error_get_errno: get error number, only valid when err_ret is
> + *   QB_ERR_INTERNAL_ERR.
> + *
> + * return negative errno or 0 if last error is not QB_ERR_INTERNAL_ERR.

So does this return EINVAL or -EINVAL?  If you return positive errno
values, then you can reserve 0 for no error, and a QB_*-specific
negative value in the case where QB_ERR_INTERNAL_ERR was not the last error.

-- 
Eric Blake   address@hidden    +1-919-301-3266
Libvirt virtualization library http://libvirt.org

Attachment: signature.asc
Description: OpenPGP digital signature


reply via email to

[Prev in Thread] Current Thread [Next in Thread]