mirror of
https://github.com/yunionio/cloudpods.git
synced 2026-09-19 10:46:58 +08:00
fix(hostdeployer): Umount VDDKDisk when IRootFsDriver is nil
This commit is contained in:
@@ -140,7 +140,8 @@ func (vd *VDDKDisk) Disconnect() bool {
|
||||
}
|
||||
|
||||
func (vd *VDDKDisk) MountRootfs() fsdriver.IRootFsDriver {
|
||||
if err := vd.Mount(); err == nil {
|
||||
var err error
|
||||
if err = vd.Mount(); err == nil {
|
||||
for _, mntPath := range vd.PartDirs {
|
||||
part := newVDDKPartition(mntPath)
|
||||
if fs := guestfs.DetectRootFs(part); fs != nil {
|
||||
@@ -149,6 +150,11 @@ func (vd *VDDKDisk) MountRootfs() fsdriver.IRootFsDriver {
|
||||
}
|
||||
}
|
||||
}
|
||||
if err != nil {
|
||||
log.Errorf("VDDKDisk Mount failed: %s", err)
|
||||
}
|
||||
// something is wrong
|
||||
vd.UmountRootfs(nil)
|
||||
return nil
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user