qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Stefan Hajnoczi <stefanha@redhat.com>
To: qemu-devel@nongnu.org
Cc: Fam Zheng <famz@redhat.com>,
	Stefan Hajnoczi <stefanha@redhat.com>,
	Anthony Liguori <aliguori@amazon.com>
Subject: [Qemu-devel] [PULL 7/7] vmdk: fix VMFS extent parsing
Date: Fri, 18 Oct 2013 16:18:35 +0200	[thread overview]
Message-ID: <1382105915-27735-8-git-send-email-stefanha@redhat.com> (raw)
In-Reply-To: <1382105915-27735-1-git-send-email-stefanha@redhat.com>

From: Fam Zheng <famz@redhat.com>

The VMFS extent line in description file doesn't have start offset as
FLAT lines does, and it should be defaulted to 0. The flat_offset
variable is initialized to -1, so we need to set it in this case.

Signed-off-by: Fam Zheng <famz@redhat.com>
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
---
 block/vmdk.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/block/vmdk.c b/block/vmdk.c
index b8901e2..32ec8b7 100644
--- a/block/vmdk.c
+++ b/block/vmdk.c
@@ -726,6 +726,8 @@ static int vmdk_parse_extents(const char *desc, BlockDriverState *bs,
                 error_setg(errp, "Invalid extent lines: \n%s", p);
                 return -EINVAL;
             }
+        } else if (!strcmp(type, "VMFS")) {
+            flat_offset = 0;
         } else if (ret != 4) {
             error_setg(errp, "Invalid extent lines: \n%s", p);
             return -EINVAL;
-- 
1.8.3.1

      parent reply	other threads:[~2013-10-18 14:19 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-10-18 14:18 [Qemu-devel] [PULL 0/7] Block patches Stefan Hajnoczi
2013-10-18 14:18 ` [Qemu-devel] [PULL 1/7] hmp: drop bogus "[not inserted]" Stefan Hajnoczi
2013-10-18 14:18 ` [Qemu-devel] [PULL 2/7] sd: Avoid access to NULL BlockDriverState Stefan Hajnoczi
2013-10-18 14:18 ` [Qemu-devel] [PULL 3/7] blockdev: fix cdrom read_only flag Stefan Hajnoczi
2013-10-18 14:18 ` [Qemu-devel] [PULL 4/7] block/raw-win32: Always use -errno in hdev_open Stefan Hajnoczi
2013-10-18 14:18 ` [Qemu-devel] [PULL 5/7] virtio: Remove unneeded memcpy Stefan Hajnoczi
2013-10-18 14:18 ` [Qemu-devel] [PULL 6/7] vmdk: Only read cid from image file when opening Stefan Hajnoczi
2013-10-18 14:18 ` Stefan Hajnoczi [this message]

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=1382105915-27735-8-git-send-email-stefanha@redhat.com \
    --to=stefanha@redhat.com \
    --cc=aliguori@amazon.com \
    --cc=famz@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).