From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:56755) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TvWk6-0003Fi-QV for qemu-devel@nongnu.org; Wed, 16 Jan 2013 12:25:40 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1TvWk4-0007Xh-10 for qemu-devel@nongnu.org; Wed, 16 Jan 2013 12:25:38 -0500 Received: from mx1.redhat.com ([209.132.183.28]:13550) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TvWk3-0007XX-Oy for qemu-devel@nongnu.org; Wed, 16 Jan 2013 12:25:35 -0500 Message-ID: <50F6E28B.1010603@redhat.com> Date: Wed, 16 Jan 2013 10:25:31 -0700 From: Eric Blake MIME-Version: 1.0 References: <1358349851-20960-1-git-send-email-ehabkost@redhat.com> <1358349851-20960-7-git-send-email-ehabkost@redhat.com> In-Reply-To: <1358349851-20960-7-git-send-email-ehabkost@redhat.com> Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="----enig2ELXALNGUCQSJOXAPTVRM" Subject: Re: [Qemu-devel] [PATCH 6/8] vl.c: Use parse_uint_full() for NUMA nodeid List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Eduardo Habkost Cc: Chegu Vinod , qemu-devel@nongnu.org, Anthony Liguori This is an OpenPGP/MIME signed message (RFC 4880 and 3156) ------enig2ELXALNGUCQSJOXAPTVRM Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable On 01/16/2013 08:24 AM, Eduardo Habkost wrote: > This should catch many kinds of errors that the current code wasn't > checking for: >=20 > - Values that can't be parsed as a number > - Negative values > - Overflow > - Empty string >=20 > Signed-off-by: Eduardo Habkost > --- > Cc: Eric Blake > --- > vl.c | 7 +++++-- > 1 file changed, 5 insertions(+), 2 deletions(-) >=20 > +++ b/vl.c > @@ -1264,11 +1264,14 @@ static void numa_add(const char *optarg) > if (get_param_value(option, 128, "nodeid", optarg) =3D=3D 0) {= > nodenr =3D nb_numa_nodes; > } else { > - nodenr =3D strtoull(option, NULL, 10); > + if (parse_uint_full(option, &nodenr) < 0) { This allows a user to pass octal or hex numbers, where previously it was forced to be decimal. That means 'nodeid=3D010' is now '8' instead of '10'; is that intentional? > =20 > if (nodenr >=3D MAX_NODES) { > - fprintf(stderr, "qemu: invalid NUMA nodeid: %d\n", nodenr)= ; > + fprintf(stderr, "qemu: invalid NUMA nodeid: %llu\n", noden= r); Already mentions that this part belongs in 5/8. --=20 Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org ------enig2ELXALNGUCQSJOXAPTVRM Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.13 (GNU/Linux) Comment: Public key at http://people.redhat.com/eblake/eblake.gpg Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/ iQEcBAEBCAAGBQJQ9uKLAAoJEKeha0olJ0NqSUEH/jP6qAzTiLSbA1CC5oj7tOR4 gyRgmCZvQ9kGawvdk4RP6xdRgDf+K2KCSv3VFP9qny3eF9R4AuvI4MquB5CRSD0x 5haHd+wjfHcn1Vyqe0tNhLnspEeNrbr+IfxjWW+JsyGbvHxbi840ATZPZ55JOdTN jecb+t4AvOnzrCXFvjEkaOMYnlU8vodOFbXLu25mJZEUUwGTjlyXWTn8CF+VmFSs snoe457yONMp5N413gswpgg3MnLeVFiyT1CYsfe+7U5VhCTDdsrabpuLwk7A7ssF xudFqKrBmtB0tyz1GCR8C6JClhGi/t8+jLd1NbLh5QeTFJLcFG2PlI1EmRkEmNo= =iyKE -----END PGP SIGNATURE----- ------enig2ELXALNGUCQSJOXAPTVRM--