diff mbox

[v2,4/4] log: Permit -dfilter 0..0xffffffffffffffff

Message ID 1466440173-21990-5-git-send-email-armbru@redhat.com (mailing list archive)
State New, archived
Headers show

Commit Message

Markus Armbruster June 20, 2016, 4:29 p.m. UTC
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>
---
 tests/test-logging.c | 5 +++--
 util/log.c           | 2 +-
 2 files changed, 4 insertions(+), 3 deletions(-)

Comments

Eric Blake June 20, 2016, 6:25 p.m. UTC | #1
On 06/20/2016 10:29 AM, Markus Armbruster wrote:
> 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>
> ---
>  tests/test-logging.c | 5 +++--
>  util/log.c           | 2 +-
>  2 files changed, 4 insertions(+), 3 deletions(-)

Reviewed-by: Eric Blake <eblake@redhat.com>
diff mbox

Patch

diff --git a/tests/test-logging.c b/tests/test-logging.c
index b6fa94e..cdf13c6 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 4da635c..b6c75b1 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;
         }