From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:38297) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bjXTk-0007yr-Fr for qemu-devel@nongnu.org; Mon, 12 Sep 2016 16:05:21 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bjXTh-0003oG-6u for qemu-devel@nongnu.org; Mon, 12 Sep 2016 16:05:20 -0400 Received: from mx1.redhat.com ([209.132.183.28]:44416) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bjXTg-0003o1-Un for qemu-devel@nongnu.org; Mon, 12 Sep 2016 16:05:17 -0400 Received: from int-mx10.intmail.prod.int.phx2.redhat.com (int-mx10.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (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 72C08C0096E6 for ; Mon, 12 Sep 2016 20:05:16 +0000 (UTC) References: <20160912091913.15831-1-marcandre.lureau@redhat.com> <20160912091913.15831-2-marcandre.lureau@redhat.com> From: Eric Blake Message-ID: Date: Mon, 12 Sep 2016 15:05:15 -0500 MIME-Version: 1.0 In-Reply-To: <20160912091913.15831-2-marcandre.lureau@redhat.com> Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="Kms03LIjAWmcE9IT5RLSU4f854QL25xWe" 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: =?UTF-8?Q?Marc-Andr=c3=a9_Lureau?= , qemu-devel@nongnu.org Cc: armbru@redhat.com This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --Kms03LIjAWmcE9IT5RLSU4f854QL25xWe From: Eric Blake To: =?UTF-8?Q?Marc-Andr=c3=a9_Lureau?= , qemu-devel@nongnu.org Cc: armbru@redhat.com Message-ID: Subject: Re: [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> In-Reply-To: <20160912091913.15831-2-marcandre.lureau@redhat.com> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable On 09/12/2016 04:18 AM, Marc-Andr=C3=A9 Lureau wrote: > There are better chances to find what went wrong at build time than a > later assert in qmp_query_version >=20 > Signed-off-by: Marc-Andr=C3=A9 Lureau > --- > qmp.c | 16 +++------------- > scripts/create_config | 6 ++++++ > 2 files changed, 9 insertions(+), 13 deletions(-) >=20 > - > - err =3D qemu_strtoll(tmp, &tmp, 10, &info->qemu->micro); > - assert(err =3D=3D 0); > + info->qemu->major =3D QEMU_VERSION_MAJOR; > + info->qemu->minor =3D QEMU_VERSION_MINOR; > + info->qemu->micro =3D QEMU_VERSION_MICRO; > info->package =3D g_strdup(QEMU_PKGVERSION); > =20 > return info; The old code silently ignores any garbage after the third integer (it populates &tmp, but never checks the value of tmp). > diff --git a/scripts/create_config b/scripts/create_config > index 1dd6a35..e6929dd 100755 > --- a/scripts/create_config > +++ b/scripts/create_config > @@ -7,7 +7,13 @@ while read line; do > case $line in > VERSION=3D*) # configuration > 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. 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 Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org --Kms03LIjAWmcE9IT5RLSU4f854QL25xWe 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/ iQEcBAEBCAAGBQJX1wp7AAoJEKeha0olJ0NqhRcIAKOrzXZ5GudPvN0CtqRyS8cp hQqa06nEnjZvHZXbzTXts7r6YVecTeZ3FNqOXu7N/3ok7RDiSJoono6X42kxNJ9G BOfICuJBHeTGGmVqOi65z3KNbP75ZVP0hr8vsrWksXLfWMfSGFlyZMo1lddyjUsN 42CDG9ynmuWfelTH9rEJo41PCkXyVimr/HcQfzgII0FZHsFYMMZx8Wo+dRlhZeiA 8aSpeg4t/ixAWPCpOXbL101XUlUWpHwl6ZPUDTL26JQBNtliBNhkLF/yrjZXI9tA Br9pFcdKDnaKr2XxImTJbyRXILmpMt7zqh0HQ1SDmwi1qP7YIfzL/FJs2Pkk/uo= =cce2 -----END PGP SIGNATURE----- --Kms03LIjAWmcE9IT5RLSU4f854QL25xWe--