From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:42095) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Yt16r-0007y1-7U for qemu-devel@nongnu.org; Thu, 14 May 2015 17:56:06 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Yt16n-0002yB-6g for qemu-devel@nongnu.org; Thu, 14 May 2015 17:56:05 -0400 Received: from mx1.redhat.com ([209.132.183.28]:50350) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Yt16m-0002y7-Up for qemu-devel@nongnu.org; Thu, 14 May 2015 17:56:01 -0400 Received: from int-mx13.intmail.prod.int.phx2.redhat.com (int-mx13.intmail.prod.int.phx2.redhat.com [10.5.11.26]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id t4ELu024004590 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL) for ; Thu, 14 May 2015 17:56:00 -0400 Message-ID: <555519EE.1090301@redhat.com> Date: Thu, 14 May 2015 15:55:58 -0600 From: Eric Blake MIME-Version: 1.0 References: <1431432187-10993-1-git-send-email-armbru@redhat.com> <1431432187-10993-13-git-send-email-armbru@redhat.com> In-Reply-To: <1431432187-10993-13-git-send-email-armbru@redhat.com> Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="PAa9roxRVOPWqNIXUlUE57R4QJgq7BUb1" Subject: Re: [Qemu-devel] [PATCH 12/15] tap-bsd: Convert tap_open() to Error List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Markus Armbruster , qemu-devel@nongnu.org Cc: stefanha@redhat.com This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --PAa9roxRVOPWqNIXUlUE57R4QJgq7BUb1 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable On 05/12/2015 06:03 AM, Markus Armbruster wrote: > Fixes inappropriate use of stderr in monitor command handler. >=20 > While there, improve some of the messages a bit. >=20 > Signed-off-by: Markus Armbruster > --- > net/tap-bsd.c | 33 ++++++++++++++------------------- > 1 file changed, 14 insertions(+), 19 deletions(-) >=20 > @@ -139,14 +133,15 @@ int tap_open(char *ifname, int ifname_size, int *= vnet_hdr, > /* User requested the interface to have a specific name */ > s =3D socket(AF_LOCAL, SOCK_DGRAM, 0); > if (s < 0) { > - error_report("could not open socket to set interface name"= ); > + error_setg_errno(errp, errno, > + "could not open socket to set interface n= ame"); > goto error; > } > ifr.ifr_data =3D ifname; > ret =3D ioctl(s, SIOCSIFNAME, (void *)&ifr); > close(s); > if (ret < 0) { > - error_report("could not set tap interface name"); > + error_setg_errno(errp, errno, "could not set tap interface= name"); Bad. close() may have clobbered errno before you get to report it. > goto error; > } > } else { > @@ -158,14 +153,14 @@ int tap_open(char *ifname, int ifname_size, int *= vnet_hdr, > *vnet_hdr =3D 0; > =20 > if (vnet_hdr_required && !*vnet_hdr) { > - error_report("vnet_hdr=3D1 requested, but no kernel " > - "support for IFF_VNET_HDR available"); > + error_setg(errp, "vnet_hdr=3D1 requested, but no kernel " > + "support for IFF_VNET_HDR available"); > goto error; > } > } > if (mq_required) { > - error_report("mq_required requested, but not kernel support" > - "for IFF_MULTI_QUEUE available"); > + error_setg(errp, "mq_required requested, but not kernel suppor= t" As long as you are touching this, s/not/no/ > + "for IFF_MULTI_QUEUE available"); > goto error; > } > =20 >=20 --=20 Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org --PAa9roxRVOPWqNIXUlUE57R4QJgq7BUb1 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/ iQEcBAEBCAAGBQJVVRnuAAoJEKeha0olJ0NqibIH/1/wppEI5TjlmsB+hjzBjTuO S1LOP89Knw6b5pMyyg2pIl3i7XcysgbWW58yId1OgVKZcaQdnGyLXRD1J3+PdRa5 yHhJ9U+M7DrBp0A0wROO3M9sgVgWzBlV1b1W+flyx6A5DQCWkZR6IHIPFYRYFLFB a9NM5J5S4GtS+M8HPqvW9F1SN419BVBUS2F7CpMeIqSF+TUXRitQqDGjOcdxjPZ+ w6kwJEULSKaEZQLYfswl44A1oOPRHTtmO1Hp+UVDr5i6TE1uVUWDgtECmF3sVkie N/TfRVSV9z9FeiUbZqmtiy1rrbHQk91lqGX+DiTPf/UfW/Pjy/3NFu+NBJczmHo= =/53r -----END PGP SIGNATURE----- --PAa9roxRVOPWqNIXUlUE57R4QJgq7BUb1--