9ae3a8
From f9da89c13d9e9bde2d5da525ea6ad2ac92404ec4 Mon Sep 17 00:00:00 2001
9ae3a8
From: Paolo Bonzini <pbonzini@redhat.com>
9ae3a8
Date: Mon, 19 Aug 2013 18:54:28 +0800
9ae3a8
Subject: [PATCH 13/13] vmdk: support vmfs files
9ae3a8
9ae3a8
Message-id: <1377573001-27070-14-git-send-email-famz@redhat.com>
9ae3a8
Patchwork-id: 53793
9ae3a8
O-Subject: [RHEL-7 qemu-kvm PATCH 13/13] vmdk: support vmfs files
9ae3a8
Bugzilla: 995866
9ae3a8
RH-Acked-by: Paolo Bonzini <pbonzini@redhat.com>
9ae3a8
RH-Acked-by: Stefan Hajnoczi <stefanha@redhat.com>
9ae3a8
RH-Acked-by: Kevin Wolf <kwolf@redhat.com>
9ae3a8
9ae3a8
VMware ESX hosts also use different create and extent types for flat
9ae3a8
files, respectively "vmfs" and "VMFS".  This is not documented, but it
9ae3a8
can be found at http://kb.vmware.com/kb/10002511 (Recreating a missing
9ae3a8
virtual machine disk (VMDK) descriptor file).
9ae3a8
9ae3a8
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
9ae3a8
Signed-off-by: Fam Zheng <famz@redhat.com>
9ae3a8
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
9ae3a8
(cherry picked from commit 04d542c8b826a1196ca4f03f5a35d83035976bd1)
9ae3a8
Signed-off-by: Fam Zheng <famz@redhat.com>
9ae3a8
---
9ae3a8
 block/vmdk.c |    5 +++--
9ae3a8
 1 files changed, 3 insertions(+), 2 deletions(-)
9ae3a8
9ae3a8
diff --git a/block/vmdk.c b/block/vmdk.c
9ae3a8
index 4d0c82a..b0b419b 100644
9ae3a8
--- a/block/vmdk.c
9ae3a8
+++ b/block/vmdk.c
9ae3a8
@@ -719,7 +719,7 @@ static int vmdk_parse_extents(const char *desc, BlockDriverState *bs,
9ae3a8
 
9ae3a8
         if (sectors <= 0 ||
9ae3a8
             (strcmp(type, "FLAT") && strcmp(type, "SPARSE") &&
9ae3a8
-             strcmp(type, "VMFSSPARSE")) ||
9ae3a8
+             strcmp(type, "VMFS") && strcmp(type, "VMFSSPARSE")) ||
9ae3a8
             (strcmp(access, "RW"))) {
9ae3a8
             goto next_line;
9ae3a8
         }
9ae3a8
@@ -732,7 +732,7 @@ static int vmdk_parse_extents(const char *desc, BlockDriverState *bs,
9ae3a8
         }
9ae3a8
 
9ae3a8
         /* save to extents array */
9ae3a8
-        if (!strcmp(type, "FLAT")) {
9ae3a8
+        if (!strcmp(type, "FLAT") || !strcmp(type, "VMFS")) {
9ae3a8
             /* FLAT extent */
9ae3a8
             VmdkExtent *extent;
9ae3a8
 
9ae3a8
@@ -790,6 +790,7 @@ static int vmdk_open_desc_file(BlockDriverState *bs, int flags,
9ae3a8
         goto exit;
9ae3a8
     }
9ae3a8
     if (strcmp(ct, "monolithicFlat") &&
9ae3a8
+        strcmp(ct, "vmfs") &&
9ae3a8
         strcmp(ct, "vmfsSparse") &&
9ae3a8
         strcmp(ct, "twoGbMaxExtentSparse") &&
9ae3a8
         strcmp(ct, "twoGbMaxExtentFlat")) {
9ae3a8
-- 
9ae3a8
1.7.1
9ae3a8