From: Fam Zheng <famz@redhat.com>
To: qemu-devel@nongnu.org
Cc: kwolf@redhat.com, stefanha@redhat.com
Subject: [Qemu-devel] [PATCH 1/2] vmdk: Allow read only open of VMDK version 3
Date: Wed, 27 Nov 2013 10:06:30 +0800 [thread overview]
Message-ID: <1385517991-19194-2-git-send-email-famz@redhat.com> (raw)
In-Reply-To: <1385517991-19194-1-git-send-email-famz@redhat.com>
Signed-off-by: Fam Zheng <famz@redhat.com>
---
block/vmdk.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/block/vmdk.c b/block/vmdk.c
index a7ebd0f..7c64bed 100644
--- a/block/vmdk.c
+++ b/block/vmdk.c
@@ -605,13 +605,16 @@ static int vmdk_open_vmdk4(BlockDriverState *bs,
header = footer.header;
}
- if (le32_to_cpu(header.version) >= 3) {
+ if (le32_to_cpu(header.version) > 3) {
char buf[64];
snprintf(buf, sizeof(buf), "VMDK version %d",
le32_to_cpu(header.version));
qerror_report(QERR_UNKNOWN_BLOCK_FORMAT_FEATURE,
bs->device_name, "vmdk", buf);
return -ENOTSUP;
+ } else if (le32_to_cpu(header.version) == 3 && flags & BDRV_O_RDWR) {
+ error_setg(errp, "VMDK version 3 must be read only");
+ return -EINVAL;
}
if (le32_to_cpu(header.num_gtes_per_gt) > 512) {
--
1.8.4.2
next prev parent reply other threads:[~2013-11-27 2:06 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-11-27 2:06 [Qemu-devel] [PATCH 0/2] vmdk: Allow version 3 read only open Fam Zheng
2013-11-27 2:06 ` Fam Zheng [this message]
2013-11-27 11:32 ` [Qemu-devel] [PATCH 1/2] vmdk: Allow read only open of VMDK version 3 Paolo Bonzini
2013-11-27 2:06 ` [Qemu-devel] [PATCH 2/2] qemu-iotests: Add sample image and test for " Fam Zheng
2013-11-27 15:31 ` [Qemu-devel] [PATCH 0/2] vmdk: Allow version 3 read only open 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=1385517991-19194-2-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).