Skip to content

Commit 677c96e

Browse files
author
Zhang Wenhao
committed
<fix>[kvm]: add null check for dstHostUuid in secure boot
Add a null check for dstHostUuid before querying TPM info in KvmSecureBootExtensions to prevent NullPointerException when destination host is not specified. Resolves: ZSV-11731 Related: ZSV-11310 Change-Id: I75706a697969776f617667686864617376717274
1 parent 4db6aab commit 677c96e

1 file changed

Lines changed: 5 additions & 0 deletions

File tree

plugin/kvm/src/main/java/org/zstack/kvm/efi/KvmSecureBootExtensions.java

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -168,6 +168,11 @@ public void preVmMigration(VmInstanceInventory vm, VmMigrationType type, String
168168
return;
169169
}
170170

171+
if (dstHostUuid == null) {
172+
completion.success();
173+
return;
174+
}
175+
171176
String tpmUuid = Q.New(TpmVO.class)
172177
.eq(TpmVO_.vmInstanceUuid, vm.getUuid())
173178
.select(TpmVO_.uuid)

0 commit comments

Comments
 (0)