Skip to content

Commit d59cc1f

Browse files
CLOUDSTACK-6831 [Hyper-V] Improve the logging for VM snapshot failures as it is not supported. Right now it is throwing NPEs
1 parent 945e879 commit d59cc1f

1 file changed

Lines changed: 7 additions & 1 deletion

File tree

‎engine/schema/src/com/cloud/hypervisor/dao/HypervisorCapabilitiesDaoImpl.java‎

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,6 +101,12 @@ public Integer getMaxHostsPerCluster(HypervisorType hypervisorType, String hyper
101101
@Override
102102
public Boolean isVmSnapshotEnabled(HypervisorType hypervisorType, String hypervisorVersion) {
103103
HypervisorCapabilitiesVO result = getCapabilities(hypervisorType, hypervisorVersion);
104-
return result.getVmSnapshotEnabled();
104+
// if default capability profile not present for any hypervisor type result will be null.
105+
// So returning vm snapshot not supported if there is no default capability profile for hypervisor.
106+
if (result != null) {
107+
return result.getVmSnapshotEnabled();
108+
} else {
109+
return false;
110+
}
105111
}
106112
}

0 commit comments

Comments
 (0)