Skip to content

Commit 00a6bf5

Browse files
fix npe while checking for block disk type
1 parent ce19418 commit 00a6bf5

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

plugins/hypervisors/kvm/src/main/java/com/cloud/hypervisor/kvm/resource/LibvirtComputingResource.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2985,9 +2985,10 @@ public String getVolumePath(final Connect conn, final DiskTO volume, boolean dis
29852985

29862986
public static boolean useBLOCKDiskType(KVMPhysicalDisk physicalDisk) {
29872987
return physicalDisk != null &&
2988-
physicalDisk.getPool().getType() == StoragePoolType.Linstor &&
2988+
physicalDisk.getPool() != null &&
2989+
StoragePoolType.Linstor.equals(physicalDisk.getPool().getType()) &&
29892990
physicalDisk.getFormat() != null &&
2990-
physicalDisk.getFormat()== PhysicalDiskFormat.RAW;
2991+
PhysicalDiskFormat.RAW.equals(physicalDisk.getFormat());
29912992
}
29922993

29932994
public static DiskDef.DiskType getDiskType(KVMPhysicalDisk physicalDisk) {

0 commit comments

Comments
 (0)