Skip to content

Commit

Permalink
log: Permit -dfilter 0..0xffffffffffffffff
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Markus Armbruster authored and mstsirkin committed Jul 4, 2016
1 parent 6dd726a commit 58eeb83
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
5 changes: 3 additions & 2 deletions tests/test-logging.c
Expand Up @@ -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);

Expand Down
2 changes: 1 addition & 1 deletion util/log.c
Expand Up @@ -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;
}
Expand Down

0 comments on commit 58eeb83

Please sign in to comment.