fix cache non lvm disks (#7459)

This commit is contained in:
wanyaoqi
2020-08-01 21:10:02 +08:00
committed by GitHub
parent 7e55869cad
commit 2cdfed2cab

View File

@@ -124,7 +124,9 @@ func (d *SKVMGuestDisk) Connect() bool {
if pathType == LVM_PATH {
d.setupLVMS()
} else if pathType == PATH_TYPE_UNKNOWN {
if hasLVM, err := d.setupLVMS(); !hasLVM && err == nil {
hasLVM, err := d.setupLVMS()
// no lvm partition found and has partitions
if !hasLVM && err == nil && len(d.partitions) > 0 {
d.cacheNonLVMImagePath()
}
}