aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarkus Armbruster <armbru@redhat.com>2016-07-01 13:47:49 +0200
committerMichael S. Tsirkin <mst@redhat.com>2016-07-04 16:49:33 +0300
commit58eeb83cc7c445f167c951493deddf45621d66bb (patch)
tree601feb320c1b1d5c0ff7ea0a17a333f7678241fb
parent6dd726a2bf1b800289d90a84d5fcb5ce7b78a8e1 (diff)
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>
-rw-r--r--tests/test-logging.c5
-rw-r--r--util/log.c2
2 files changed, 4 insertions, 3 deletions
diff --git a/tests/test-logging.c b/tests/test-logging.c
index b6fa94ee35..cdf13c6ba5 100644
--- a/tests/test-logging.c
+++ b/tests/test-logging.c
@@ -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);
diff --git a/util/log.c b/util/log.c
index 4da635c8c9..b6c75b1102 100644
--- a/util/log.c
+++ b/util/log.c
@@ -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;
}