From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:40731) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YsvfA-0001DM-Se for qemu-devel@nongnu.org; Thu, 14 May 2015 12:07:09 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Ysvf7-0003mu-M6 for qemu-devel@nongnu.org; Thu, 14 May 2015 12:07:08 -0400 Received: from mx1.redhat.com ([209.132.183.28]:40868) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Ysvf7-0003mU-Dl for qemu-devel@nongnu.org; Thu, 14 May 2015 12:07:05 -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 (8.14.4/8.14.4) with ESMTP id t4EG74ev019710 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL) for ; Thu, 14 May 2015 12:07:04 -0400 Message-ID: <5554C827.1050402@redhat.com> Date: Thu, 14 May 2015 10:07:03 -0600 From: Eric Blake MIME-Version: 1.0 References: <1431432187-10993-1-git-send-email-armbru@redhat.com> <1431432187-10993-4-git-send-email-armbru@redhat.com> In-Reply-To: <1431432187-10993-4-git-send-email-armbru@redhat.com> Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="lB536963wjjhQLJCsuE26LuACQSDsBj33" Subject: Re: [Qemu-devel] [PATCH 03/15] net: Improve -net nic 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) --lB536963wjjhQLJCsuE26LuACQSDsBj33 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable On 05/12/2015 06:02 AM, Markus Armbruster wrote: > When -net nic fails, it first reports a specific error, then a generic > one, like this: >=20 > $ qemu-system-x86_64 -net nic,netdev=3Dnonexistant > qemu-system-x86_64: -net nic,netdev=3Dnonexistant: netdev 'nonexist= ant' not found > qemu-system-x86_64: -net nic,netdev=3Dnonexistant: Device 'nic' cou= ld not be initialized s/nonexistant/nonexistent/g >=20 > Convert net_init_nic() to Error to get rid of the unwanted second > error message. >=20 > Signed-off-by: Markus Armbruster > --- > net/net.c | 12 ++++++------ > 1 file changed, 6 insertions(+), 6 deletions(-) >=20 > @@ -745,7 +744,7 @@ static int net_init_nic(const NetClientOptions *opt= s, const char *name, > =20 > idx =3D nic_get_free_idx(); > if (idx =3D=3D -1 || nb_nics >=3D MAX_NICS) { > - error_report("Too Many NICs"); > + error_setg(errp, "Too Many NICs"); worth s/Many/many/ while touching this? Reviewed-by: Eric Blake --=20 Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org --lB536963wjjhQLJCsuE26LuACQSDsBj33 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/ iQEcBAEBCAAGBQJVVMgnAAoJEKeha0olJ0NqfqsH/3d/0H7Tr62PCgF6Plj9ESIR CV4duc0HYPHE4y3cXO/FDHtP2Pt2lU0cCPNYiCQxxml4SdGe0yvbU0QTSeMimHwO zTfGK/ZJnZRa/8Shi+i4Iq+KL6GQ5uhvoJpoGclU/nQPbg5+DGs/Ezj0vwXg8a+x rSHqIGdE7sWngGgx/ud4aCJWUtcJyhdzX1Lt6mE5uhfN3L4E8U5hWK3MyL2b8SA+ NfyMsKWgKBVT9ORpvfG+Bd6b/YrerC4CDrnpP4JrmHbTGSFgO3EDXRBNRJof45HZ sDexiQvnnmn93IXi3lmKYHl63xeG+k/Eh0UYOOTDefjAt3eChaYeP087PGxHzSs= =PtKy -----END PGP SIGNATURE----- --lB536963wjjhQLJCsuE26LuACQSDsBj33--