cryptospore / rpms / qemu-kvm

Forked from rpms/qemu-kvm 2 years ago
Clone
218e99
From dc64463e65223377bfb4a925f2f047b50090b32a Mon Sep 17 00:00:00 2001
218e99
From: Fam Zheng <famz@redhat.com>
218e99
Date: Thu, 7 Nov 2013 16:07:08 +0100
218e99
Subject: [PATCH 23/25] vmdk: fix VMFS extent parsing
218e99
218e99
RH-Author: Fam Zheng <famz@redhat.com>
218e99
Message-id: <1383795369-10623-3-git-send-email-famz@redhat.com>
218e99
Patchwork-id: 55586
218e99
O-Subject: [RHEL-7 qemu-kvm PATCH 2/2] vmdk: fix VMFS extent parsing
218e99
Bugzilla: 995866
218e99
RH-Acked-by: Amos Kong <akong@redhat.com>
218e99
RH-Acked-by: Max Reitz <mreitz@redhat.com>
218e99
RH-Acked-by: Kevin Wolf <kwolf@redhat.com>
218e99
218e99
The VMFS extent line in description file doesn't have start offset as
218e99
FLAT lines does, and it should be defaulted to 0. The flat_offset
218e99
variable is initialized to -1, so we need to set it in this case.
218e99
218e99
Signed-off-by: Fam Zheng <famz@redhat.com>
218e99
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
218e99
(cherry picked from commit dbbcaa8d4358fdf3c42bf01e9e2d687300e84770)
218e99
Signed-off-by: Fam Zheng <famz@redhat.com>
218e99
Signed-off-by: Miroslav Rezanina <mrezanin@redhat.com>
218e99
---
218e99
 block/vmdk.c |    2 ++
218e99
 1 files changed, 2 insertions(+), 0 deletions(-)
218e99
218e99
diff --git a/block/vmdk.c b/block/vmdk.c
218e99
index f2237cf..026b440 100644
218e99
--- a/block/vmdk.c
218e99
+++ b/block/vmdk.c
218e99
@@ -737,6 +737,8 @@ static int vmdk_parse_extents(const char *desc, BlockDriverState *bs,
218e99
                 error_setg(errp, "Invalid extent lines: \n%s", p);
218e99
                 return -EINVAL;
218e99
             }
218e99
+        } else if (!strcmp(type, "VMFS")) {
218e99
+            flat_offset = 0;
218e99
         } else if (ret != 4) {
218e99
             error_setg(errp, "Invalid extent lines: \n%s", p);
218e99
             return -EINVAL;
218e99
-- 
218e99
1.7.1
218e99