From: Fam Zheng <famcool@gmail.com>
To: qemu-devel@nongnu.org
Cc: Kevin Wolf <kwolf@redhat.com>,
Stefan Hajnoczi <stefanha@gmail.com>,
Christoph Hellwig <hch@lst.de>
Subject: [Qemu-devel] [PATCH 03/12] VMDK: probe for mono flat image
Date: Sat, 4 Jun 2011 08:40:50 +0800 [thread overview]
Message-ID: <BANLkTinhGOyTPOAAi6btDB73GYDvaUb2Dw@mail.gmail.com> (raw)
vmdk_probe for mono flat images.
Signed-off-by: Fam Zheng <famcool@gmail.com>
---
block/vmdk.c | 13 ++++++++++---
1 files changed, 10 insertions(+), 3 deletions(-)
diff --git a/block/vmdk.c b/block/vmdk.c
index f787528..bf8d02a 100644
--- a/block/vmdk.c
+++ b/block/vmdk.c
@@ -101,10 +101,17 @@ static int vmdk_probe(const uint8_t *buf, int
buf_size, const char *filename)
return 0;
magic = be32_to_cpu(*(uint32_t *)buf);
if (magic == VMDK3_MAGIC ||
- magic == VMDK4_MAGIC)
+ magic == VMDK4_MAGIC) {
return 100;
- else
- return 0;
+ } else {
+ char *cid_p, *ct_p, *extent_p;
+ cid_p = strstr((char *)buf, "CID");
+ ct_p = strstr((char *)buf, "createType");
+ extent_p = strstr((char *)buf, "RW");
+ if (cid_p && ct_p && extent_p)
+ return 100;
+ }
+ return 0;
}
#define CHECK_CID 1
next reply other threads:[~2011-06-04 0:41 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-06-04 0:40 Fam Zheng [this message]
2011-06-14 8:06 ` [Qemu-devel] [PATCH 03/12] VMDK: probe for mono flat image Stefan Hajnoczi
2011-06-15 4:26 ` Fam Zheng
2011-06-15 5:31 ` Stefan Hajnoczi
2011-06-15 5:45 ` Fam Zheng
2011-06-15 6:10 ` 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=BANLkTinhGOyTPOAAi6btDB73GYDvaUb2Dw@mail.gmail.com \
--to=famcool@gmail.com \
--cc=hch@lst.de \
--cc=kwolf@redhat.com \
--cc=qemu-devel@nongnu.org \
--cc=stefanha@gmail.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).