qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] [PATCH 1/4] error: New error_fatal


From: Eric Blake
Subject: Re: [Qemu-devel] [PATCH 1/4] error: New error_fatal
Date: Fri, 11 Sep 2015 09:13:04 -0600
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.2.0

On 09/11/2015 08:51 AM, Markus Armbruster wrote:
> Similar to error_abort, but doesn't report where the error was
> created, and terminates the process with exit(1) rather than abort().
> 
> Signed-off-by: Markus Armbruster <address@hidden>
> ---
>  include/qapi/error.h | 11 +++++++++++
>  util/error.c         | 34 +++++++++++++++++++++-------------
>  2 files changed, 32 insertions(+), 13 deletions(-)

Reviewed-by: Eric Blake <address@hidden>

> 
> diff --git a/include/qapi/error.h b/include/qapi/error.h
> index d7878c3..c69dddb 100644
> --- a/include/qapi/error.h
> +++ b/include/qapi/error.h
> @@ -50,6 +50,9 @@
>   * Call a function aborting on errors:
>   *     foo(arg, &error_abort);
>   *
> + * Call a function treating errors as fatal:
> + *     foo(arg, &error_fatal);
> + *

Might be worth a bit more explanatory text: error_abort is for
diagnosing programmer errors (the situation cannot occur unless someone
introduced a bug), while error_fatal is for gracefully diagnosing user
errors at startup (the VM can't be booted because the user asked for the
impossible).

-- 
Eric Blake   eblake redhat com    +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]