From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:38264) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bDKGl-0004L6-EL for qemu-devel@nongnu.org; Wed, 15 Jun 2016 19:30:48 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bDKGg-0007Lc-DA for qemu-devel@nongnu.org; Wed, 15 Jun 2016 19:30:46 -0400 Received: from mx1.redhat.com ([209.132.183.28]:59649) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bDKGg-0007LQ-7Z for qemu-devel@nongnu.org; Wed, 15 Jun 2016 19:30:42 -0400 Received: from int-mx09.intmail.prod.int.phx2.redhat.com (int-mx09.intmail.prod.int.phx2.redhat.com [10.5.11.22]) (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 0FE7E693F5 for ; Wed, 15 Jun 2016 23:30:41 +0000 (UTC) References: <1466023310-13221-1-git-send-email-armbru@redhat.com> <1466023310-13221-2-git-send-email-armbru@redhat.com> From: Eric Blake Message-ID: <5761E520.60307@redhat.com> Date: Wed, 15 Jun 2016 17:30:40 -0600 MIME-Version: 1.0 In-Reply-To: <1466023310-13221-2-git-send-email-armbru@redhat.com> Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="EwDJoBtkKhBfheQdktOtIshK4MWli1ho9" Subject: Re: [Qemu-devel] [PATCH RFC 1/4] log: Clean up misuse of Range for -dfilter List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Markus Armbruster , qemu-devel@nongnu.org Cc: mst@redhat.com, pbonzini@redhat.com This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --EwDJoBtkKhBfheQdktOtIshK4MWli1ho9 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable On 06/15/2016 02:41 PM, Markus Armbruster wrote: > Range encodes an integer interval [a,b] as { begin =3D a, end =3D b + 1= }, > where a \in [0,2^64-1] and b \in [1,2^64]. Thus, zero end is to be > interpreted as 2^64. >=20 > The implementation of -dfilter (commit 3514552) uses Range > differently: it encodes [a,b] as { begin =3D a, end =3D b }. The code > works, but it contradicts the specification of Range in range.h. >=20 > Switch to the specified representation. Since it can't represent > [0,UINT64_MAX], we have to reject that now. Add a test for it. >=20 > While we're rejecting anyway: observe that we reject -dfilter LOB..UPB > where LOB > UPB when UPB is zero, but happily create an empty Range > when it isn't. Reject it then, too, and add a test for it. >=20 > While there, add a positive test for the problematic upper bound > UINT64_MAX. >=20 > Signed-off-by: Markus Armbruster > --- > tests/test-logging.c | 10 ++++++++++ > util/log.c | 28 +++++++++++++++------------- > 2 files changed, 25 insertions(+), 13 deletions(-) >=20 Reviewed-by: Eric Blake --=20 Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org --EwDJoBtkKhBfheQdktOtIshK4MWli1ho9 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/ iQEcBAEBCAAGBQJXYeUgAAoJEKeha0olJ0NqTgYH/1mJNDf2UdW9Lzg68SIdv9ii DK+NokQ2Yu+LJxdYzm/ZS0kUkJQ+IcBpTnnT3wUOAefs6FCRPpt4iJmjOusHrvvt eHTXrYcDgag4ysE7BuUJ88GZlMJmMx4NIupUgM/imViKrhglnAtUvCYKy5wZ6/JX ZEQRtvCALje6rJnTyUVGJEIooi5ZPQyePgcC2B7htEUlXvhgPcGedndJEUhOE5y/ YUX9sS8xM1uICnYo5arK3yX4rE+VhcZE9XaYL9UouX/odq+nUFD8rbC24EFjLK8I 4dad3lz9NCkKyerGx5ytpFb7ixYV6Hzfbrs5Uk/L4oJFnZnyJpRla3nsVOmCqJk= =Daya -----END PGP SIGNATURE----- --EwDJoBtkKhBfheQdktOtIshK4MWli1ho9--