From 323836b1f813cdee1a7f0f179aed78925775396d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=B1=88=E8=BD=A9?= Date: Tue, 19 Feb 2019 17:25:55 +0800 Subject: [PATCH] =?UTF-8?q?=E8=AF=86=E5=88=AB=E6=96=B0=E7=89=88vmdk?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pkg/util/vmdkutils/vmdkutils.go | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/pkg/util/vmdkutils/vmdkutils.go b/pkg/util/vmdkutils/vmdkutils.go index b3c10940de..7a88ce5753 100644 --- a/pkg/util/vmdkutils/vmdkutils.go +++ b/pkg/util/vmdkutils/vmdkutils.go @@ -24,7 +24,9 @@ type SVMDKInfo struct { } const ( - extentPatternString = `^RW \d+ VMFS\w* \"(?P[^"]+)` + //RW 20971520 VMFS "89334fec-7013-46cb-8d7b-8271cbe1a175_1-flat.vmdk" + //RW 62914560 SESPARSE "89334fec-7013-46cb-8d7b-8271cbe1a175-sesparse.vmdk" + extentPatternString = `^RW \d+ (VMFS|SESPARSE)\w* \"(?P[^"]+)` ) var ( @@ -44,7 +46,7 @@ func ParseStream(stream io.Reader) (*SVMDKInfo, error) { matches := extentPatternRegexp.FindStringSubmatch(line) if len(matches) > 0 { // log.Debugf("%#v", matches) - info.ExtentFile = matches[1] + info.ExtentFile = matches[2] findExtent = true } else { equalPos := strings.IndexByte(line, '=')