From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:35693) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VUJrN-0005tg-O0 for qemu-devel@nongnu.org; Thu, 10 Oct 2013 13:17:20 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VUJrH-0002ix-GS for qemu-devel@nongnu.org; Thu, 10 Oct 2013 13:17:13 -0400 Received: from mx1.redhat.com ([209.132.183.28]:23992) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VUJrH-0002iH-7M for qemu-devel@nongnu.org; Thu, 10 Oct 2013 13:17:07 -0400 Received: from int-mx02.intmail.prod.int.phx2.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id r9AHH6h9013964 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Thu, 10 Oct 2013 13:17:06 -0400 Message-ID: <5256E110.2010900@redhat.com> Date: Thu, 10 Oct 2013 11:17:04 -0600 From: Eric Blake MIME-Version: 1.0 References: <1381412644-16212-1-git-send-email-mreitz@redhat.com> <1381412644-16212-4-git-send-email-mreitz@redhat.com> In-Reply-To: <1381412644-16212-4-git-send-email-mreitz@redhat.com> Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="mfOd9mKJsLwi8quJT03BVgXX4XP6a3d7W" Subject: Re: [Qemu-devel] [PATCH 3/5] block/raw-win32: Employ error parameter List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Max Reitz Cc: Kevin Wolf , qemu-devel@nongnu.org, Stefan Hajnoczi This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --mfOd9mKJsLwi8quJT03BVgXX4XP6a3d7W Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable On 10/10/2013 07:44 AM, Max Reitz wrote: > Make use of the error parameter in the opening and creating functions i= n > block/raw-win32.c. >=20 > Signed-off-by: Max Reitz > --- > block/raw-win32.c | 16 +++++++++++----- > 1 file changed, 11 insertions(+), 5 deletions(-) > @@ -586,8 +590,10 @@ static int hdev_open(BlockDriverState *bs, QDict *= options, int flags, > int err =3D GetLastError(); > =20 > if (err =3D=3D ERROR_ACCESS_DENIED) { > + error_setg_errno(errp, EACCES, "Could not open device"); > ret =3D -EACCES; > } else { > + error_setg(errp, "Could not open device"); > ret =3D -1; Pre-existing, but that looks fishy. Mixing -1 and -errno in the same function is generally wrong. --=20 Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org --mfOd9mKJsLwi8quJT03BVgXX4XP6a3d7W 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.14 (GNU/Linux) Comment: Public key at http://people.redhat.com/eblake/eblake.gpg Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/ iQEcBAEBCAAGBQJSVuEQAAoJEKeha0olJ0NqrjUIAJFsPoxLW8QpduOzZ8viigWA Fgwcv7wpEtQ5DjXGrCWVIKO62XCugXQVLzRmp0zjVNrks3SDmhHhDqqjF4h8CFRC zeXyaze74tIex4cKhJfiYHFg6vYhjKFrSLfKJ4FW6NVpDSIqH2LJ+enXelOM+B60 UML8Nkn70TKHAV7hdNC7L8fixVhp9ZnYQceRRT1M32UjUv54/a2dA1oUPzXaDSk3 Oma+60IYUiItgyV/Jeaqyrxs/MDfqFwVy6jzsPjlku9PHCVStWNCr9iFohwwMIr5 M7n5nKRQX2fpTd6ooflbwoEFZyS1CcmFrcz7zPOwoG+1D0TUWx4NVx5LtMDb5PI= =xgAf -----END PGP SIGNATURE----- --mfOd9mKJsLwi8quJT03BVgXX4XP6a3d7W--