From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1LVXww-0001mG-Gp for qemu-devel@nongnu.org; Fri, 06 Feb 2009 16:09:22 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1LVXwr-0001hQ-TR for qemu-devel@nongnu.org; Fri, 06 Feb 2009 16:09:19 -0500 Received: from [199.232.76.173] (port=51586 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1LVXwr-0001gs-Ns for qemu-devel@nongnu.org; Fri, 06 Feb 2009 16:09:17 -0500 Received: from mx2.redhat.com ([66.187.237.31]:54575) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1LVXwq-0007nw-LM for qemu-devel@nongnu.org; Fri, 06 Feb 2009 16:09:17 -0500 Received: from int-mx2.corp.redhat.com (int-mx2.corp.redhat.com [172.16.27.26]) by mx2.redhat.com (8.13.8/8.13.8) with ESMTP id n16L9EX7001159 for ; Fri, 6 Feb 2009 16:09:14 -0500 Received: from ns3.rdu.redhat.com (ns3.rdu.redhat.com [10.11.255.199]) by int-mx2.corp.redhat.com (8.13.1/8.13.1) with ESMTP id n16L9Dxs029481 for ; Fri, 6 Feb 2009 16:09:14 -0500 Received: from blackpad.localdomain (vpn-10-11.bos.redhat.com [10.16.10.11]) by ns3.rdu.redhat.com (8.13.8/8.13.8) with ESMTP id n16L9DPo014585 for ; Fri, 6 Feb 2009 16:09:13 -0500 From: Eduardo Habkost Date: Fri, 6 Feb 2009 19:08:55 -0200 Message-Id: <1233954540-4754-5-git-send-email-ehabkost@redhat.com> In-Reply-To: <1233954540-4754-1-git-send-email-ehabkost@redhat.com> References: <1233954540-4754-1-git-send-email-ehabkost@redhat.com> Subject: [Qemu-devel] [PATCH 4/9] qcow: define QCOW_CRYPT_MAX Reply-To: qemu-devel@nongnu.org List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Just to make the code a bit more readable, and get ready to make AES optional. Signed-off-by: Eduardo Habkost --- block-qcow.c | 3 ++- block-qcow2.c | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/block-qcow.c b/block-qcow.c index 91c53b1..4fdd0d8 100644 --- a/block-qcow.c +++ b/block-qcow.c @@ -34,6 +34,7 @@ #define QCOW_CRYPT_NONE 0 #define QCOW_CRYPT_AES 1 +#define QCOW_CRYPT_MAX QCOW_CRYPT_AES #define QCOW_OFLAG_COMPRESSED (1LL << 63) @@ -113,7 +114,7 @@ static int qcow_open(BlockDriverState *bs, const char *filename, int flags) goto fail; if (header.size <= 1 || header.cluster_bits < 9) goto fail; - if (header.crypt_method > QCOW_CRYPT_AES) + if (header.crypt_method > QCOW_CRYPT_MAX) goto fail; s->crypt_method_header = header.crypt_method; if (s->crypt_method_header) diff --git a/block-qcow2.c b/block-qcow2.c index 465dcd6..d1503e9 100644 --- a/block-qcow2.c +++ b/block-qcow2.c @@ -51,6 +51,7 @@ #define QCOW_CRYPT_NONE 0 #define QCOW_CRYPT_AES 1 +#define QCOW_CRYPT_MAX QCOW_CRYPT_AES #define QCOW_MAX_CRYPT_CLUSTERS 32 @@ -228,7 +229,7 @@ static int qcow_open(BlockDriverState *bs, const char *filename, int flags) header.cluster_bits < 9 || header.cluster_bits > 16) goto fail; - if (header.crypt_method > QCOW_CRYPT_AES) + if (header.crypt_method > QCOW_CRYPT_MAX) goto fail; s->crypt_method_header = header.crypt_method; if (s->crypt_method_header) -- 1.6.0.2.GIT