Skip to content

Commit b13926a

Browse files
author
Zhang Wenhao
committed
<fix>[kvm]: disable host status check when syncing VM host files
Add disableHostStatusCheck() method to KvmCommandSender to allow skipping host status validation. Apply it in KvmSecureBootManager when syncing VM host files, so the sync can proceed regardless of host connection state. Resolves: ZSV-11767 Related: ZSV-11310 Change-Id: I6c68756c7378636a6c6669656869717077716268
1 parent 78c679d commit b13926a

2 files changed

Lines changed: 7 additions & 1 deletion

File tree

plugin/kvm/src/main/java/org/zstack/kvm/KvmCommandSender.java

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,11 @@ public KvmCommandSender(String hostUuid, boolean noStatusCheck) {
6969
DebugUtils.Assert(hostUuid != null, "hostUuid cannot be null");
7070
}
7171

72+
public KvmCommandSender disableHostStatusCheck() {
73+
this.noStatusCheck = true;
74+
return this;
75+
}
76+
7277
public void send(final Object cmd, final String path, final KvmCommandFailureChecker checker, final SteppingSendCallback<KvmResponseWrapper> completion) {
7378
List<KVMHostAsyncHttpCallMsg> msgs = hostUuids.stream().map(huuid -> {
7479
KVMHostAsyncHttpCallMsg msg = new KVMHostAsyncHttpCallMsg();

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -204,7 +204,8 @@ static class CloneVmHostFileContext {
204204
}
205205

206206
private void handle(SyncVmHostFilesFromHostMsg msg) {
207-
KvmCommandSender sender = new KvmCommandSender(msg.getHostUuid());
207+
KvmCommandSender sender = new KvmCommandSender(msg.getHostUuid())
208+
.disableHostStatusCheck();
208209

209210
KVMAgentCommands.ReadVmHostFileContentCmd cmd = new KVMAgentCommands.ReadVmHostFileContentCmd();
210211
cmd.setHostFiles(new ArrayList<>());

0 commit comments

Comments
 (0)