log: Permit -dfilter 0..0xffffffffffffffff

Works fine since the previous commit fixed the underlying range data
type.  Of course it filters out nothing, but so does
0..1,2..0xffffffffffffffff, and we don't bother rejecting that either.

Signed-off-by: Markus Armbruster <armbru@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
This commit is contained in:
Markus Armbruster 2016-07-01 13:47:49 +02:00 committed by Michael S. Tsirkin
parent 6dd726a2bf
commit 58eeb83cc7
2 changed files with 4 additions and 3 deletions

View File

@ -73,8 +73,9 @@ static void test_parse_range(void)
g_assert_false(qemu_log_in_addr_range(UINT64_MAX - 1));
qemu_set_dfilter_ranges("0..0xffffffffffffffff", &err);
error_free_or_abort(&err);
g_assert(qemu_log_in_addr_range(0));
g_assert(qemu_log_in_addr_range(UINT64_MAX));
qemu_set_dfilter_ranges("2..1", &err);
error_free_or_abort(&err);

View File

@ -204,7 +204,7 @@ void qemu_set_dfilter_ranges(const char *filter_spec, Error **errp)
default:
g_assert_not_reached();
}
if (lob > upb || (lob == 0 && upb == UINT64_MAX)) {
if (lob > upb) {
error_setg(errp, "Invalid range");
goto out;
}