qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] Common header file for error codes


From: Eric Blake
Subject: Re: [Qemu-devel] Common header file for error codes
Date: Wed, 21 May 2014 08:19:00 -0600
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101 Thunderbird/24.5.0

On 05/21/2014 07:24 AM, Anshul Makkar wrote:
> Hi,
> 
> Doesn't there exist a common header file for all the return codes. In the
> code I can see return values as 0, -1 etc.

Most functions that flag failure via the return value do so by returning
merely 0 or -1.  There's a few that return 0 or -errno.  More often,
instead of encoding error categories into a return value, we instead
prefer to use the QAPI error type 'struct Error' (see
include/qapi/error.h), which has categories for the few places where it
is needed, along with utility functions for setting error messages.

-- 
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]