From: Fam Zheng <famz@redhat.com>
To: qemu-devel@nongnu.org
Cc: kwolf@redhat.com, Fam Zheng <famz@redhat.com>, stefanha@redhat.com
Subject: [Qemu-devel] [PATCH v3 4/6] vmdk: change magic number to macro
Date: Wed, 24 Apr 2013 20:44:33 +0800 [thread overview]
Message-ID: <1366807475-26350-5-git-send-email-famz@redhat.com> (raw)
In-Reply-To: <1366807475-26350-1-git-send-email-famz@redhat.com>
Two hard coded flag bits are changed to macros.
Signed-off-by: Fam Zheng <famz@redhat.com>
---
block/vmdk.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/block/vmdk.c b/block/vmdk.c
index cc19e20..0463d3b 100644
--- a/block/vmdk.c
+++ b/block/vmdk.c
@@ -32,6 +32,7 @@
#define VMDK3_MAGIC (('C' << 24) | ('O' << 16) | ('W' << 8) | 'D')
#define VMDK4_MAGIC (('K' << 24) | ('D' << 16) | ('M' << 8) | 'V')
#define VMDK4_COMPRESSION_DEFLATE 1
+#define VMDK4_FLAG_NL_DETECT (1 << 0)
#define VMDK4_FLAG_RGD (1 << 1)
/* Zeroed-grain enable bit */
#define VMDK4_FLAG_ZERO_GRAIN (1 << 2)
@@ -1287,7 +1288,7 @@ static int vmdk_create_extent(const char *filename, int64_t filesize,
magic = cpu_to_be32(VMDK4_MAGIC);
memset(&header, 0, sizeof(header));
header.version = zeroed_grain ? 2 : 1;
- header.flags = 3
+ header.flags = VMDK4_FLAG_RGD | VMDK4_FLAG_NL_DETECT
| (compress ? VMDK4_FLAG_COMPRESS | VMDK4_FLAG_MARKER : 0)
| (zeroed_grain ? VMDK4_FLAG_ZERO_GRAIN : 0);
header.compressAlgorithm = compress ? VMDK4_COMPRESSION_DEFLATE : 0;
--
1.8.1.4
next prev parent reply other threads:[~2013-04-24 12:44 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-04-24 12:44 [Qemu-devel] [PATCH v3 0/6] vmdk: zeroed-grain GTE support Fam Zheng
2013-04-24 12:44 ` [Qemu-devel] [PATCH v3 1/6] vmdk: named return code Fam Zheng
2013-04-24 12:44 ` [Qemu-devel] [PATCH v3 2/6] vmdk: add support for “zeroed‐grain” GTE Fam Zheng
2013-04-24 12:44 ` [Qemu-devel] [PATCH v3 3/6] vmdk: Add option to create zeroed-grain image Fam Zheng
2013-04-24 12:44 ` Fam Zheng [this message]
2013-04-24 12:44 ` [Qemu-devel] [PATCH v3 5/6] vmdk: store fields of VmdkMetaData in cpu endian Fam Zheng
2013-04-25 13:20 ` Stefan Hajnoczi
2013-04-24 12:44 ` [Qemu-devel] [PATCH v3 6/6] vmdk: add bdrv_co_write_zeroes Fam Zheng
2013-04-25 13:20 ` Stefan Hajnoczi
2013-04-25 13:25 ` [Qemu-devel] [PATCH v3 0/6] vmdk: zeroed-grain GTE support Stefan Hajnoczi
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=1366807475-26350-5-git-send-email-famz@redhat.com \
--to=famz@redhat.com \
--cc=kwolf@redhat.com \
--cc=qemu-devel@nongnu.org \
--cc=stefanha@redhat.com \
/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).