From: Eduardo Habkost <ehabkost@redhat.com>
To: qemu-devel@nongnu.org
Subject: [Qemu-devel] [PATCH 4/9] qcow: define QCOW_CRYPT_MAX
Date: Fri, 6 Feb 2009 19:08:55 -0200 [thread overview]
Message-ID: <1233954540-4754-5-git-send-email-ehabkost@redhat.com> (raw)
In-Reply-To: <1233954540-4754-1-git-send-email-ehabkost@redhat.com>
Just to make the code a bit more readable, and get ready to make AES
optional.
Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
---
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
next prev parent reply other threads:[~2009-02-06 21:09 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-02-06 21:08 [Qemu-devel] [PATCH 0/9] encryption code changes Eduardo Habkost
2009-02-06 21:08 ` [Qemu-devel] [PATCH 1/9] vnc: abort on unknown options Eduardo Habkost
2009-02-06 21:08 ` [Qemu-devel] [PATCH 2/9] drive_init: Don't try to read passwords before monitor setup Eduardo Habkost
2009-02-06 21:08 ` [Qemu-devel] [PATCH 3/9] monitor_readline: poll pending bottom halves before readline_start() Eduardo Habkost
2009-02-06 21:08 ` Eduardo Habkost [this message]
2009-02-06 21:08 ` [Qemu-devel] [PATCH 5/9] qcow: make encryption support optional Eduardo Habkost
2009-02-06 21:08 ` [Qemu-devel] [PATCH 6/9] vnc: make DES-challenge authentication (aka "VNC auth") optional Eduardo Habkost
2009-02-06 21:08 ` [Qemu-devel] [PATCH 7/9] configure: add check for libgcrypt Eduardo Habkost
2009-02-06 21:08 ` [Qemu-devel] [PATCH 8/9] qcow: use libgcrypt AES implementation Eduardo Habkost
2009-02-06 21:09 ` [Qemu-devel] [PATCH 9/9] vnc: use libgcrypt for DES-challenge authentication Eduardo Habkost
2009-02-06 21:57 ` [Qemu-devel] Re: [PATCH 0/9] encryption code changes Jan Kiszka
2009-02-06 23:43 ` [Qemu-devel] " Anthony Liguori
2009-02-07 11:06 ` Daniel P. Berrange
2009-02-09 20:57 ` Eduardo Habkost
2009-02-07 11:00 ` Daniel P. Berrange
2009-02-14 22:23 ` Anthony Liguori
2009-02-18 23:57 ` Eduardo Habkost
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1233954540-4754-5-git-send-email-ehabkost@redhat.com \
--to=ehabkost@redhat.com \
--cc=qemu-devel@nongnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).