From: Eric Blake <eblake@redhat.com>
To: Markus Armbruster <armbru@redhat.com>, qemu-devel@nongnu.org
Cc: mst@redhat.com, pbonzini@redhat.com
Subject: Re: [Qemu-devel] [PATCH RFC 1/4] log: Clean up misuse of Range for -dfilter
Date: Wed, 15 Jun 2016 17:30:40 -0600 [thread overview]
Message-ID: <5761E520.60307@redhat.com> (raw)
In-Reply-To: <1466023310-13221-2-git-send-email-armbru@redhat.com>
[-- Attachment #1: Type: text/plain, Size: 1246 bytes --]
On 06/15/2016 02:41 PM, Markus Armbruster wrote:
> Range encodes an integer interval [a,b] as { begin = a, end = 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.
>
> The implementation of -dfilter (commit 3514552) uses Range
> differently: it encodes [a,b] as { begin = a, end = b }. The code
> works, but it contradicts the specification of Range in range.h.
>
> Switch to the specified representation. Since it can't represent
> [0,UINT64_MAX], we have to reject that now. Add a test for it.
>
> 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.
>
> While there, add a positive test for the problematic upper bound
> UINT64_MAX.
>
> Signed-off-by: Markus Armbruster <armbru@redhat.com>
> ---
> tests/test-logging.c | 10 ++++++++++
> util/log.c | 28 +++++++++++++++-------------
> 2 files changed, 25 insertions(+), 13 deletions(-)
>
Reviewed-by: Eric Blake <eblake@redhat.com>
--
Eric Blake eblake redhat com +1-919-301-3266
Libvirt virtualization library http://libvirt.org
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 604 bytes --]
next prev parent reply other threads:[~2016-06-15 23:30 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-06-15 20:41 [Qemu-devel] [PATCH RFC 0/4] range: Make it simpler & safer Markus Armbruster
2016-06-15 20:41 ` [Qemu-devel] [PATCH RFC 1/4] log: Clean up misuse of Range for -dfilter Markus Armbruster
2016-06-15 23:30 ` Eric Blake [this message]
2016-06-19 3:24 ` Michael S. Tsirkin
2016-06-15 20:41 ` [Qemu-devel] [PATCH RFC 2/4] range: Eliminate direct Range member access Markus Armbruster
2016-06-15 23:50 ` Eric Blake
2016-06-16 7:50 ` Markus Armbruster
2016-06-19 3:25 ` Michael S. Tsirkin
2016-06-20 7:26 ` Markus Armbruster
2016-06-15 20:41 ` [Qemu-devel] [PATCH RFC 3/4] range: Drop the previous commit's trickery Markus Armbruster
2016-06-15 23:53 ` Eric Blake
2016-06-19 3:28 ` Michael S. Tsirkin
2016-06-20 7:28 ` Markus Armbruster
2016-06-15 20:41 ` [Qemu-devel] [PATCH RFC 4/4] range: Replace internal representation of Range Markus Armbruster
2016-06-15 23:57 ` Eric Blake
2016-06-16 8:04 ` Markus Armbruster
2016-06-19 3:24 ` Michael S. Tsirkin
2016-06-20 7:33 ` Markus Armbruster
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=5761E520.60307@redhat.com \
--to=eblake@redhat.com \
--cc=armbru@redhat.com \
--cc=mst@redhat.com \
--cc=pbonzini@redhat.com \
--cc=qemu-devel@nongnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.