From 45f5619d51c62a94e30f8172781649c69d23fbd3 Mon Sep 17 00:00:00 2001 From: Jerome Forissier Date: Wed, 3 Jan 2024 15:39:08 +0100 Subject: [PATCH] qemu-check.exp: protect access to $::env(XEN_FFA) If the XEN_FFA environment variable is not set, $::env(XEN_FFA) raises an exception. It is the case when using qemu.mk (while qemu_v8.mk correctly sets XEN_FFA always before invoking qem-check.exp): $ make check [...] no such variable (read trace on "::env(XEN_FFA)") invoked from within "if {$::env(XEN_FFA) == "y"} { set cmd2 "xl create guest_ffa.cfg" } else { set cmd2 "xl create guest.cfg" }" (file "/home/jerome/work/optee_repo_qemu/build/../build/qemu-check.exp" line 15) make: *** [Makefile:194: check] Error 1 Rather than introducing XEN_FFA in qemu.mk where is doesn't apply, guard the $::env(XEN_FFA) statement with an 'if {[info exists ::env(XEN_FFA)] ...' in qemu-check.exp. Fixes: 4809b4f67fa8 ("qemu_v8: support for FF-A in Xen") Signed-off-by: Jerome Forissier Reviewed-by: Jens Wiklander --- qemu-check.exp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/qemu-check.exp b/qemu-check.exp index 5e03d311..22e9b530 100644 --- a/qemu-check.exp +++ b/qemu-check.exp @@ -12,7 +12,7 @@ set bios "../out/bios-qemu/bios.bin" set cmd1 "cd /mnt/host/build/qemu_v8/xen" -if {$::env(XEN_FFA) == "y"} { +if {[info exists ::env(XEN_FFA)] && $::env(XEN_FFA) == "y"} { set cmd2 "xl create guest_ffa.cfg" } else { set cmd2 "xl create guest.cfg"