From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:47749) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Wn7MK-0007ii-R6 for qemu-devel@nongnu.org; Wed, 21 May 2014 10:19:14 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Wn7MF-0003Co-3A for qemu-devel@nongnu.org; Wed, 21 May 2014 10:19:08 -0400 Received: from mx1.redhat.com ([209.132.183.28]:58046) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Wn7ME-0003CP-Fk for qemu-devel@nongnu.org; Wed, 21 May 2014 10:19:02 -0400 Message-ID: <537CB5D4.5050008@redhat.com> Date: Wed, 21 May 2014 08:19:00 -0600 From: Eric Blake MIME-Version: 1.0 References: In-Reply-To: Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="1CaPnVH1XGRfLOMIpC6boacT1uUb81F2O" Subject: Re: [Qemu-devel] Common header file for error codes List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Anshul Makkar , qemu-devel This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --1CaPnVH1XGRfLOMIpC6boacT1uUb81F2O Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable On 05/21/2014 07:24 AM, Anshul Makkar wrote: > Hi, >=20 > Doesn't there exist a common header file for all the return codes. In t= he > 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. --=20 Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org --1CaPnVH1XGRfLOMIpC6boacT1uUb81F2O Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 Comment: Public key at http://people.redhat.com/eblake/eblake.gpg Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/ iQEcBAEBCAAGBQJTfLXUAAoJEKeha0olJ0Nq2kMH/j7wM3ciGpOio42Jr6pbhDmp YhIvYkhA9CJUJuLhr95wRexCBf3nijQPSwRBE5nJao2AITVaqTYvfq5UbebDXncN dRLKprUivR5kpKC/oq91jZYFSsKb2tnWLSjSdlgUm198YjmOw3XJAyDRJ94GTX1J PqGvRGTfGyTnDwkszkJjdij8KWh1S6dUy6eL9yBwywkW1fdRaKl5/YqRGdXuJ3Gg aAejJcRdRjg1WSw2n15rzAbfdf2L/2idNHtRrUX+rxGh+nWszxHZswiqNLMVaCOf PtZ1SORAF25t8u/NhVAyxJfiVy482c34Xo6mmAVqc32cecDOb9ety2GPTvhWdPs= =Ay0s -----END PGP SIGNATURE----- --1CaPnVH1XGRfLOMIpC6boacT1uUb81F2O--