From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:52105) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZlenF-0008Pg-00 for qemu-devel@nongnu.org; Mon, 12 Oct 2015 11:13:45 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZlenA-0003od-Ri for qemu-devel@nongnu.org; Mon, 12 Oct 2015 11:13:40 -0400 Received: from mx1.redhat.com ([209.132.183.28]:51873) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZlenA-0003oV-ND for qemu-devel@nongnu.org; Mon, 12 Oct 2015 11:13:36 -0400 Received: from int-mx10.intmail.prod.int.phx2.redhat.com (int-mx10.intmail.prod.int.phx2.redhat.com [10.5.11.23]) by mx1.redhat.com (Postfix) with ESMTPS id 50D2C461C3 for ; Mon, 12 Oct 2015 15:13:36 +0000 (UTC) References: <1444637004-20195-1-git-send-email-pbonzini@redhat.com> <1444637004-20195-7-git-send-email-pbonzini@redhat.com> From: Eric Blake Message-ID: <561BCE1F.9020700@redhat.com> Date: Mon, 12 Oct 2015 09:13:35 -0600 MIME-Version: 1.0 In-Reply-To: <1444637004-20195-7-git-send-email-pbonzini@redhat.com> Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="hoeMGv2u1MeKWWfXjwEPvFM9HRhq1dgDV" Subject: Re: [Qemu-devel] [PATCH 06/21] qemu-char: convert parallel backend to data-driven creation List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Paolo Bonzini , qemu-devel@nongnu.org Cc: armbru@redhat.com This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --hoeMGv2u1MeKWWfXjwEPvFM9HRhq1dgDV Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable On 10/12/2015 02:03 AM, Paolo Bonzini wrote: > Conversion to Error * brings better error messages; before: >=20 > qemu-system-x86_64: -chardev id=3Dserial,backend=3Dparallel,path=3D= vl.c: Failed to create chardev >=20 > After: >=20 > qemu-system-x86_64: -chardev id=3Dserial,backend=3Dparallel,path=3D= vl.c: not a parallel port: Inappropriate ioctl for device >=20 > Signed-off-by: Paolo Bonzini > --- > qemu-char.c | 28 ++++++++++++++++++---------- > 1 file changed, 18 insertions(+), 10 deletions(-) >=20 > +static CharDriverState *qemu_chr_open_pp_fd(int fd, Error **errp) > { > CharDriverState *chr; > ParallelCharDriver *drv; > =20 > if (ioctl(fd, PPCLAIM) < 0) { > close(fd); > + error_setg_errno(errp, errno, "not a parallel port"); Swap this line with the close(), since close() can clobber errno. > @@ -4265,11 +4273,9 @@ ChardevReturn *qmp_chardev_add(const char *id, C= hardevBackend *backend, > case CHARDEV_BACKEND_KIND_SERIAL: > abort(); > break; > -#ifdef HAVE_CHARDEV_PARPORT > case CHARDEV_BACKEND_KIND_PARALLEL: > - chr =3D qmp_chardev_open_parallel(backend->parallel, &loca= l_err); > + abort(); > break; Another dead break. With the error reporting fixed, Reviewed-by: Eric Blake --=20 Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org --hoeMGv2u1MeKWWfXjwEPvFM9HRhq1dgDV Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 Comment: Public key at http://people.redhat.com/eblake/eblake.gpg Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/ iQEcBAEBCAAGBQJWG84fAAoJEKeha0olJ0Nq8HAH/A9tQPv2F0+HafjFZjNXpvLR OSwUPzxaADvOnCa883vYzrFd46ePdsZNSwEEF8FofDB1OXWUpK37GVkIPqz23Qzr gvGsZE1Jo7S8WyWtCs7Ws+5aaQemUnZWNntlwuX77U2ssYLbkdVrz/qfwqDl9/VR tvCEa0QCVF9leXyKK1KXV7YnZTVT1PT7229R1Zy80iWIgpaTprs3eqnXFazMXBcN dOHOWXxRpGQBQBIo3jO7VM236yCIEB4jOwkCRBi8ADWw95PKGCOIYc2yxXMSch1v NCXL+81zCGdSZXUFqEchC7S9BxS+v3jouocsKI2bXsoS+F9ybLqL0dgCUXNvQmM= =TsLF -----END PGP SIGNATURE----- --hoeMGv2u1MeKWWfXjwEPvFM9HRhq1dgDV--