Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion server/src/main/java/com/cloud/hypervisor/KVMGuru.java
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ public VirtualMachineTO implement(VirtualMachineProfile vm) {
guestOsMapping = _guestOsHypervisorDao.findByOsIdAndHypervisor(guestOS.getId(), getHypervisorType().toString(), host.getHypervisorVersion());
}
if (guestOsMapping == null || host == null) {
to.setPlatformEmulator("Other");
to.setPlatformEmulator(guestOS.getDisplayName());
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@ustcweizhou how about we check and fallback to "Other" in case guestOS.getDisplayName() is null or empty (unlikely but just to make code more defensive)?

} else {
to.setPlatformEmulator(guestOsMapping.getGuestOsName());
}
Expand Down