cryptospore / rpms / qemu-kvm

Forked from rpms/qemu-kvm 2 years ago
Clone
Blob Blame History Raw
From dc64463e65223377bfb4a925f2f047b50090b32a Mon Sep 17 00:00:00 2001
From: Fam Zheng <famz@redhat.com>
Date: Thu, 7 Nov 2013 16:07:08 +0100
Subject: [PATCH 23/25] vmdk: fix VMFS extent parsing

RH-Author: Fam Zheng <famz@redhat.com>
Message-id: <1383795369-10623-3-git-send-email-famz@redhat.com>
Patchwork-id: 55586
O-Subject: [RHEL-7 qemu-kvm PATCH 2/2] vmdk: fix VMFS extent parsing
Bugzilla: 995866
RH-Acked-by: Amos Kong <akong@redhat.com>
RH-Acked-by: Max Reitz <mreitz@redhat.com>
RH-Acked-by: Kevin Wolf <kwolf@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>
(cherry picked from commit dbbcaa8d4358fdf3c42bf01e9e2d687300e84770)
Signed-off-by: Fam Zheng <famz@redhat.com>
Signed-off-by: Miroslav Rezanina <mrezanin@redhat.com>
---
 block/vmdk.c |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/block/vmdk.c b/block/vmdk.c
index f2237cf..026b440 100644
--- a/block/vmdk.c
+++ b/block/vmdk.c
@@ -737,6 +737,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.7.1