From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:44617) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VTtix-0007yc-KZ for qemu-devel@nongnu.org; Wed, 09 Oct 2013 09:22:53 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VTtir-000717-L3 for qemu-devel@nongnu.org; Wed, 09 Oct 2013 09:22:47 -0400 Received: from mx1.redhat.com ([209.132.183.28]:19006) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VTtir-00070x-CB for qemu-devel@nongnu.org; Wed, 09 Oct 2013 09:22:41 -0400 Received: from int-mx12.intmail.prod.int.phx2.redhat.com (int-mx12.intmail.prod.int.phx2.redhat.com [10.5.11.25]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id r99DMeNh001749 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Wed, 9 Oct 2013 09:22:40 -0400 Message-ID: <5255589E.4070101@redhat.com> Date: Wed, 09 Oct 2013 15:22:38 +0200 From: Max Reitz MIME-Version: 1.0 References: <1379666231-10443-1-git-send-email-mreitz@redhat.com> <1379666231-10443-6-git-send-email-mreitz@redhat.com> <20131009130753.GN8994@dhcp-200-207.str.redhat.com> In-Reply-To: <20131009130753.GN8994@dhcp-200-207.str.redhat.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH 5/6] qcow2: Add more overlap check bitmask macros List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Kevin Wolf Cc: qemu-devel@nongnu.org, Stefan Hajnoczi On 2013-10-09 15:07, Kevin Wolf wrote: > Am 20.09.2013 um 10:37 hat Max Reitz geschrieben: >> Introduces the macros QCOW2_OL_CONSTANT and QCOW2_OL_ALL in addition to >> the already existing QCOW2_OL_CACHED, signifying all metadata overlap >> checks that can be performed in constant time (regardless of image size >> etc.) and truly all available overlap checks, respectively. >> >> Signed-off-by: Max Reitz >> --- >> block/qcow2.h | 14 +++++++++++--- >> 1 file changed, 11 insertions(+), 3 deletions(-) >> >> diff --git a/block/qcow2.h b/block/qcow2.h >> index 067ed2f..098c14f 100644 >> --- a/block/qcow2.h >> +++ b/block/qcow2.h >> @@ -326,11 +326,19 @@ typedef enum QCow2MetadataOverlap { >> QCOW2_OL_INACTIVE_L2 = (1 << QCOW2_OL_INACTIVE_L2_BITNR), >> } QCow2MetadataOverlap; >> >> +/* Perform all overlap checks which can be done in constant time */ >> +#define QCOW2_OL_CONSTANT \ >> + (QCOW2_OL_MAIN_HEADER | QCOW2_OL_ACTIVE_L1 | QCOW2_OL_REFCOUNT_TABLE | \ >> + QCOW2_OL_SNAPSHOT_TABLE) >> + >> /* Perform all overlap checks which don't require disk access */ >> #define QCOW2_OL_CACHED \ >> - (QCOW2_OL_MAIN_HEADER | QCOW2_OL_ACTIVE_L1 | QCOW2_OL_ACTIVE_L2 | \ >> - QCOW2_OL_REFCOUNT_TABLE | QCOW2_OL_REFCOUNT_BLOCK | \ >> - QCOW2_OL_SNAPSHOT_TABLE | QCOW2_OL_INACTIVE_L1) >> + (QCOW2_OL_CONSTANT | QCOW2_OL_ACTIVE_L2 | QCOW2_OL_REFCOUNT_BLOCK | \ >> + QCOW2_OL_SNAPSHOT_TABLE) > QCOW2_OL_INACTIVE_L1 is lost here. Oh, right, I'll fix it. Thanks for reviewing, by the way. :) Max >> +/* Perform all overlap checks */ >> +#define QCOW2_OL_ALL \ >> + (QCOW2_OL_CACHED | QCOW2_OL_INACTIVE_L2) > Kevin