From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:47731) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TBBbn-0003tn-9j for qemu-devel@nongnu.org; Mon, 10 Sep 2012 17:33:35 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1TBBbi-00052s-N0 for qemu-devel@nongnu.org; Mon, 10 Sep 2012 17:33:31 -0400 Received: from mx1.redhat.com ([209.132.183.28]:58518) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TBBbi-00052a-DH for qemu-devel@nongnu.org; Mon, 10 Sep 2012 17:33:26 -0400 Message-ID: <504E5C9F.6050208@redhat.com> Date: Mon, 10 Sep 2012 15:33:19 -0600 From: Eric Blake MIME-Version: 1.0 References: <1347265586-17698-1-git-send-email-xiawenc@linux.vnet.ibm.com> <1347265586-17698-4-git-send-email-xiawenc@linux.vnet.ibm.com> In-Reply-To: <1347265586-17698-4-git-send-email-xiawenc@linux.vnet.ibm.com> Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="------------enig8908794E2CE95C62B0D0C3B9" Subject: Re: [Qemu-devel] [PATCH V2 3/6] libqblock error handling List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Wenchao Xia Cc: kwolf@redhat.com, aliguori@us.ibm.com, stefanha@gmail.com, qemu-devel@nongnu.org, blauwirbel@gmail.com, pbonzini@redhat.com This is an OpenPGP/MIME signed message (RFC 2440 and 3156) --------------enig8908794E2CE95C62B0D0C3B9 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable On 09/10/2012 02:26 AM, Wenchao Xia wrote: > This patch contains error handling APIs, which user could call them t= o > get error details. >=20 > Signed-off-by: Wenchao Xia > --- > 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 =2Eh as a potential user, rather than on the .c. > + default: > + err_ret_str =3D "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= =2E 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 err= or. --=20 Eric Blake eblake@redhat.com +1-919-301-3266 Libvirt virtualization library http://libvirt.org --------------enig8908794E2CE95C62B0D0C3B9 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.4.12 (GNU/Linux) Comment: Public key at http://people.redhat.com/eblake/eblake.gpg Comment: Using GnuPG with Mozilla - http://www.enigmail.net/ iQEcBAEBCAAGBQJQTlyfAAoJEKeha0olJ0NqY5QH/3l1emES6iHyw+2SBHRbb4ea ECld+Hm+s8SfPDCW9i81eAJV0/vUh42yG6i0JbHAvm0ecL5OfRJycUusxsBJNsvr f0r4g6MoTK6GynOcr9O/hFrJVUoGo4KtP5paEjNaHzpTAMpVLbMjh2O9lnVs8pH1 EI6BovtkbJTzNK5fRocIeQqT/Pypz47OeBGxccPT+tZCAD7Nb38RnYTytiWSuOSv Z9wiupe7E3bMbitQdVSvEW4Tno33RiwFh4Y0HqM42fH2l8nRferMV1t+A0RMcZqW u9FVZOmyu4DtsDMvaiB9hhvX+XTc8XvWb63f/16vH5UzSw4YiT6WIhtcdvKlZkc= =Gb0Q -----END PGP SIGNATURE----- --------------enig8908794E2CE95C62B0D0C3B9--