From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:50372) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bjpEi-0002VC-NN for qemu-devel@nongnu.org; Tue, 13 Sep 2016 11:03:04 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bjpEb-0002t2-NW for qemu-devel@nongnu.org; Tue, 13 Sep 2016 11:02:59 -0400 Received: from mx1.redhat.com ([209.132.183.28]:46408) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bjpEb-0002sV-FT for qemu-devel@nongnu.org; Tue, 13 Sep 2016 11:02:53 -0400 Received: from int-mx11.intmail.prod.int.phx2.redhat.com (int-mx11.intmail.prod.int.phx2.redhat.com [10.5.11.24]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id EE5EF19F5B for ; Tue, 13 Sep 2016 15:02:52 +0000 (UTC) References: <20160912091913.15831-1-marcandre.lureau@redhat.com> <20160912091913.15831-2-marcandre.lureau@redhat.com> <87r38ogso3.fsf@dusky.pond.sub.org> From: Eric Blake Message-ID: Date: Tue, 13 Sep 2016 10:02:51 -0500 MIME-Version: 1.0 In-Reply-To: <87r38ogso3.fsf@dusky.pond.sub.org> Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="pvecepa8qDmuhAcHgkOM2cvv0QPvaoxBu" Subject: Re: [Qemu-devel] [PATCH v6 01/18] build-sys: define QEMU_VERSION_{MAJOR, MINOR, MICRO} List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Markus Armbruster Cc: =?UTF-8?Q?Marc-Andr=c3=a9_Lureau?= , qemu-devel@nongnu.org This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --pvecepa8qDmuhAcHgkOM2cvv0QPvaoxBu From: Eric Blake To: Markus Armbruster Cc: =?UTF-8?Q?Marc-Andr=c3=a9_Lureau?= , qemu-devel@nongnu.org Message-ID: Subject: Re: [Qemu-devel] [PATCH v6 01/18] build-sys: define QEMU_VERSION_{MAJOR, MINOR, MICRO} References: <20160912091913.15831-1-marcandre.lureau@redhat.com> <20160912091913.15831-2-marcandre.lureau@redhat.com> <87r38ogso3.fsf@dusky.pond.sub.org> In-Reply-To: <87r38ogso3.fsf@dusky.pond.sub.org> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable On 09/13/2016 02:33 AM, Markus Armbruster wrote: >>> info->qemu =3D g_new0(VersionTriple, 1); >>> - err =3D qemu_strtoll(version, &tmp, 10, &info->qemu->major); >>> - assert(err =3D=3D 0); >>> - tmp++; >>> - >> >> The old code silently ignores any garbage after the third integer (it >> populates &tmp, but never checks the value of tmp). >=20 > It also accepts any separator character between the integers, not just > '.'. True, and didn't we have a release of qemu a few years ago (perhaps it was a downstream Red Hat release; I can't quickly find it now...) where we accidentally released the version string with a comma instead of a dot= ? >>> version=3D${line#*=3D} >>> + major=3D$(echo "$version" | cut -d. -f1) >>> + minor=3D$(echo "$version" | cut -d. -f2) >>> + micro=3D$(echo "$version" | cut -d. -f3) >>> echo "#define QEMU_VERSION \"$version\"" >>> + echo "#define QEMU_VERSION_MAJOR $major" >>> + echo "#define QEMU_VERSION_MINOR $minor" >>> + echo "#define QEMU_VERSION_MICRO $micro" >> >> The new code likewise ignores any fourth field. >=20 > Nope: >=20 > $ echo "2.7.50garbage" | cut -d. -f3 > 50garbage That's not a fourth field. I was thinking '2.7.50.0' ignoring '.0'. >=20 > The compiler will choke on >=20 > info->qemu->micro =3D QEMU_VERSION_MICRO; >=20 > because it's >=20 > info->qemu->micro =3D 50garbage; >=20 > after preprocessing. >=20 > The commit message could mention that VERSION is now parsed more > strictly (configure checks '.', the compiler checks integers), but I > guess it's not worth the bother now. Indeed, the fact that we now separate on exactly '.' instead of the end of an integer is different. >=20 >> Do we care either way? Unless someone else has a reason for why we >> should care, I'm fine with: >> Reviewed-by: Eric Blake >=20 > Does your R-by stand? Yes - while the parsing may have changed, it doesn't affect the common case of a correctly-formed VERSION file. I'm okay if you want to tweak the commit message to call out a summary of this conversation, but since the patch is already on qapi-next staging, I'm also okay if it doesn't change. --=20 Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org --pvecepa8qDmuhAcHgkOM2cvv0QPvaoxBu 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/ iQEbBAEBCAAGBQJX2BUbAAoJEKeha0olJ0NqyhUH+MmY5nmXm3sX6EB29mkrsu83 w2Hf9+Lz9suZDyC3QV/a7LcHGJlSCt0C9xqgzm9DjqFGM3KCU77QLGwPJ66qWmmu W2Xf5sgG1c3ChdfMGxniV1Yowt27anA/ofotALLJ5E/MIgZu/DGg2a9e/YBKXhuz krpYUVpcq63NqVPAHapdFWHVo3iX4ZHGqcm+t+9FxWLpuPkAb/jsS86ijyqtgPpU QzNmqUdVZ0/+0I7fXwlq3tgt8Uuv5+tZMqgg+kgyFks+rujgau0whhHhHL7KbuHk 0ZoXqezQR9vX8HvPprMc3WqR5f6P3nLApKrAEsFOpusL7eSGBeXy1MIy956dYA== =HUeW -----END PGP SIGNATURE----- --pvecepa8qDmuhAcHgkOM2cvv0QPvaoxBu--