bugfix(esxiagent): PrefetchImageCacheByCopy & SHost.FileUrlPathToDsPath

1. Fix the bug when preparing remote image by copy
2. SHost.FileUrlPathToDsPath will not work when shost has multiple storage.
This commit is contained in:
Rain
2020-01-17 10:39:41 +08:00
parent bc83e2940a
commit 5b1c97af58
+2 -2
View File
@@ -680,7 +680,7 @@ func (self *SHost) DoCreateVM(ctx context.Context, ds *SDatastore, data *jsonuti
if len(cdromPath) != 0 && !strings.HasPrefix(cdromPath, "[") {
cdromPath, err = self.FileUrlPathToDsPath(cdromPath)
if err != nil {
return nil, errors.Wrapf(err, "SHost.FileUrlPathToDsPath", cdromPath)
return nil, errors.Wrapf(err, "SHost.FileUrlPathToDsPath")
}
}
deviceChange = append(deviceChange, addDevSpec(NewCDROMDev(cdromPath, 16000, 201)))
@@ -702,7 +702,7 @@ func (self *SHost) DoCreateVM(ctx context.Context, ds *SDatastore, data *jsonuti
} else {
imagePath, err = self.FileUrlPathToDsPath(imagePath)
if err != nil {
return nil, errors.Wrapf(err, "SHost.FileUrlPathToDsPath", imagePath)
return nil, errors.Wrapf(err, "SHost.FileUrlPathToDsPath")
}
}
uuid, _ := disk.GetString("disk_id")