From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:55579) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Zqty6-0006xl-Gi for qemu-devel@nongnu.org; Mon, 26 Oct 2015 22:26:35 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Zqty5-0001Sl-Cz for qemu-devel@nongnu.org; Mon, 26 Oct 2015 22:26:34 -0400 References: <1445903114-22566-1-git-send-email-jsnow@redhat.com> <1445903114-22566-4-git-send-email-jsnow@redhat.com> From: Eric Blake Message-ID: <562EE0CE.1040401@redhat.com> Date: Mon, 26 Oct 2015 20:26:22 -0600 MIME-Version: 1.0 In-Reply-To: <1445903114-22566-4-git-send-email-jsnow@redhat.com> Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="DSMKBgQUO8LQx1DTWv1f4R6IPue0QNMHo" Subject: Re: [Qemu-devel] [PATCH v2 3/3] qemu-io: Correct error messages List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: John Snow , qemu-block@nongnu.org Cc: kwolf@redhat.com, qemu-devel@nongnu.org, mreitz@redhat.com This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --DSMKBgQUO8LQx1DTWv1f4R6IPue0QNMHo Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable On 10/26/2015 05:45 PM, John Snow wrote: > Reported-by: Max Reitz > Signed-off-by: John Snow > Reviewed-by: Eric Blake > --- > qemu-io-cmds.c | 53 ++++++++++++++++++++++++++++++++++----------------= --- > 1 file changed, 34 insertions(+), 19 deletions(-) >=20 > diff --git a/qemu-io-cmds.c b/qemu-io-cmds.c > index 44d24e8..92c6b87 100644 > --- a/qemu-io-cmds.c > +++ b/qemu-io-cmds.c > @@ -146,6 +146,21 @@ static int64_t cvtnum(const char *s) > return ret; > } > =20 > +static void print_cvtnum_err(int64_t rc, const char *arg) > +{ > + switch (rc) { > + case -EINVAL: > + printf("Parsing error: non-numeric argument," > + " or extraneous/unrecognized suffix -- %s\n", arg); > + break; > + case -ERANGE: > + printf("Parsing error: argument too large -- %s\n", arg); > + break; > + default: > + printf("Parsing error -- %s\n", arg); I still think ':' is better than ' --' in error messages, but I'll leave it up to the maintainer. --=20 Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org --DSMKBgQUO8LQx1DTWv1f4R6IPue0QNMHo 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/ iQEcBAEBCAAGBQJWLuDOAAoJEKeha0olJ0NqDjcH/1iTF3TuNiKzp1jtFhB4WOEY B6Q44DTeMQKuCCGzoO4PobNYXJOv1CPJhe47SK/zuSGl3wyYr2BJQJVsLgH2mTkT OOqaLnqTQGwxlofR4qDcbhymkrP/WhdPDejgWXC2x9ym0UfyslrQ5erw9bO/wHiQ aDMKTJ1JSKfPAkHtc4B8+IjGhiHyEpVef1yTTO7Orwu8SwGW+8dJ03V/n2FDck+B p4Hn8j/cUUZTAgdC2pCOW3r+TRptUl708XZAr7VhPDUuuiKaN189R6jAYmMChDNd cGPnjC28GG+FvtC0mzmfy7047pNoCahXx+qveAmDj3osptPVQ2tZrsRr5sIu0+Y= =Adv5 -----END PGP SIGNATURE----- --DSMKBgQUO8LQx1DTWv1f4R6IPue0QNMHo--