From bf838b80c013b1c68beb22aac7e3d61bfefb53c2 Mon Sep 17 00:00:00 2001 From: wanyaoqi <18528551+wanyaoqi@users.noreply.github.com> Date: Wed, 11 Mar 2026 19:29:50 +0800 Subject: [PATCH] fix(host): check file exist before copy ovmf vars (#24367) --- pkg/hostman/guestman/qemu/qemu.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/hostman/guestman/qemu/qemu.go b/pkg/hostman/guestman/qemu/qemu.go index 1bf1eb1fdf..48f3371995 100644 --- a/pkg/hostman/guestman/qemu/qemu.go +++ b/pkg/hostman/guestman/qemu/qemu.go @@ -297,7 +297,7 @@ func (o baseOptions) BIOS(ovmfPath, ovmfVarsPath, homedir string) (string, error guestOvmfVarsPath := path.Join(homedir, ovmfVarsName) if !fileutils2.Exists(guestOvmfVarsPath) { sourceOvmfVarsPath := ovmfPath - if ovmfVarsPath != "" { + if ovmfVarsPath != "" && fileutils2.Exists(ovmfVarsPath) { sourceOvmfVarsPath = ovmfVarsPath } err := procutils.NewRemoteCommandAsFarAsPossible("cp", "-f", sourceOvmfVarsPath, guestOvmfVarsPath).Run()