From patchwork Mon Jun 20 16:29:33 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Markus Armbruster X-Patchwork-Id: 9188309 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 6BF3C607D1 for ; Mon, 20 Jun 2016 17:23:46 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 5A3C327813 for ; Mon, 20 Jun 2016 17:23:46 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 4E96627B2F; Mon, 20 Jun 2016 17:23:46 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=2.0 tests=BAYES_00,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id EB50A27813 for ; Mon, 20 Jun 2016 17:23:45 +0000 (UTC) Received: from localhost ([::1]:45225 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bF2vJ-0003YF-2N for patchwork-qemu-devel@patchwork.kernel.org; Mon, 20 Jun 2016 13:23:45 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:34831) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bF252-0005uC-Md for qemu-devel@nongnu.org; Mon, 20 Jun 2016 12:29:45 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bF24v-00052q-E0 for qemu-devel@nongnu.org; Mon, 20 Jun 2016 12:29:43 -0400 Received: from mx1.redhat.com ([209.132.183.28]:46270) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bF24v-00052b-8j for qemu-devel@nongnu.org; Mon, 20 Jun 2016 12:29:37 -0400 Received: from int-mx10.intmail.prod.int.phx2.redhat.com (int-mx10.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id E0EB12CAF07 for ; Mon, 20 Jun 2016 16:29:36 +0000 (UTC) Received: from blackfin.pond.sub.org (ovpn-116-49.ams2.redhat.com [10.36.116.49]) by int-mx10.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id u5KGTYwt023560 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Mon, 20 Jun 2016 12:29:35 -0400 Received: by blackfin.pond.sub.org (Postfix, from userid 1000) id F0D7911386B1; Mon, 20 Jun 2016 18:29:33 +0200 (CEST) From: Markus Armbruster To: qemu-devel@nongnu.org Date: Mon, 20 Jun 2016 18:29:33 +0200 Message-Id: <1466440173-21990-5-git-send-email-armbru@redhat.com> In-Reply-To: <1466440173-21990-1-git-send-email-armbru@redhat.com> References: <1466440173-21990-1-git-send-email-armbru@redhat.com> X-Scanned-By: MIMEDefang 2.68 on 10.5.11.23 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.26]); Mon, 20 Jun 2016 16:29:36 +0000 (UTC) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PATCH v2 4/4] log: Permit -dfilter 0..0xffffffffffffffff X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: pbonzini@redhat.com, mst@redhat.com Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" X-Virus-Scanned: ClamAV using ClamSMTP 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 Reviewed-by: Eric Blake --- tests/test-logging.c | 5 +++-- util/log.c | 2 +- 2 files changed, 4 insertions(+), 3 deletions(-) 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; }