qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] Common header file for error codes
@ 2014-05-21 13:24 Anshul Makkar
  2014-05-21 14:19 ` Eric Blake
  0 siblings, 1 reply; 2+ messages in thread
From: Anshul Makkar @ 2014-05-21 13:24 UTC (permalink / raw)
  To: qemu-devel

[-- Attachment #1: Type: text/plain, Size: 221 bytes --]

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.

Am I missing something or is this some work in progress.

Thanks
Anshul Makkar
www.justkernel.com

[-- Attachment #2: Type: text/html, Size: 339 bytes --]

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [Qemu-devel] Common header file for error codes
  2014-05-21 13:24 [Qemu-devel] Common header file for error codes Anshul Makkar
@ 2014-05-21 14:19 ` Eric Blake
  0 siblings, 0 replies; 2+ messages in thread
From: Eric Blake @ 2014-05-21 14:19 UTC (permalink / raw)
  To: Anshul Makkar, qemu-devel

[-- Attachment #1: Type: text/plain, Size: 704 bytes --]

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 #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 604 bytes --]

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2014-05-21 14:19 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-05-21 13:24 [Qemu-devel] Common header file for error codes Anshul Makkar
2014-05-21 14:19 ` Eric Blake

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).