From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:50337) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Ysw8t-0006cD-KR for qemu-devel@nongnu.org; Thu, 14 May 2015 12:37:52 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Ysw8p-0005St-Fo for qemu-devel@nongnu.org; Thu, 14 May 2015 12:37:51 -0400 Received: from mx1.redhat.com ([209.132.183.28]:43798) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Ysw8p-0005Se-9n for qemu-devel@nongnu.org; Thu, 14 May 2015 12:37:47 -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 (Postfix) with ESMTPS id AEA808F02B for ; Thu, 14 May 2015 16:37:46 +0000 (UTC) Message-ID: <5554CF59.9050705@redhat.com> Date: Thu, 14 May 2015 10:37:45 -0600 From: Eric Blake MIME-Version: 1.0 References: <1431432187-10993-1-git-send-email-armbru@redhat.com> <1431432187-10993-5-git-send-email-armbru@redhat.com> In-Reply-To: <1431432187-10993-5-git-send-email-armbru@redhat.com> Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="9R1xtWjoHGQOqaO9fxauMuRmoHj5KF7le" Subject: Re: [Qemu-devel] [PATCH 04/15] net/dump: Improve -net/host_net_add dump error reporting 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) --9R1xtWjoHGQOqaO9fxauMuRmoHj5KF7le Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable On 05/12/2015 06:02 AM, Markus Armbruster wrote: > When -net dump fails, it first reports a specific error, then a > generic one, like this: >=20 > $ qemu-system-x86_64 -net dump,id=3Dfoo,file=3D/eperm > qemu-system-x86_64: -net dump,id=3Dfoo,file=3D/eperm: -net dump: ca= n't open /eperm > qemu-system-x86_64: -net dump,id=3Dfoo,file=3D/eperm: Device 'dump'= could not be initialized >=20 > Convert net_init_tap() to Error. This suppresses the unwanted second > message. >=20 > Signed-off-by: Markus Armbruster > --- > net/dump.c | 12 ++++++------ > 1 file changed, 6 insertions(+), 6 deletions(-) >=20 > @@ -111,7 +112,7 @@ static int net_dump_init(NetClientState *peer, cons= t char *device, > =20 > fd =3D open(filename, O_CREAT | O_TRUNC | O_WRONLY | O_BINARY, 064= 4); > if (fd < 0) { > - error_report("-net dump: can't open %s", filename); > + error_setg_errno(errp, errno, "-net dump: can't open %s", file= name); It also adds the strerror() text into the output of this message. Might be worth mentioning that in the commit message. Reviewed-by: Eric Blake --=20 Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org --9R1xtWjoHGQOqaO9fxauMuRmoHj5KF7le 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/ iQEcBAEBCAAGBQJVVM9ZAAoJEKeha0olJ0NqUWMH/Apux8ASrgoQn8XRXOpdlpin PK2t72eFYtvyqhSb/OKpbl6GGIi3e5uzkcSX43C75HQJCxBDxoh43RonOI6SERYx RR96kJsvnBJf//Yk2iVUoZ+dM1KS1MXVzrN0LXRpD3FkLVO6wcehh6Rb9rdBaBml hX6eI3nWHczxknbHrFauf8pECMecWZ7bJwPBhMa2O6J/JlGc5y/uNxXAzqh3oY9c H3PzI6eIxfpaQdM7jF+7zVDz2cixQNSDdkypYDe/YXXyjHQMRbgABHGJuAVd1GVr 3iDp5pfmUvYym+zSimxe8XrGZtpGehdpYtaHcwbSn/fYEltPmsqlppLIZFgYQK4= =1qhS -----END PGP SIGNATURE----- --9R1xtWjoHGQOqaO9fxauMuRmoHj5KF7le--