Skip to content

Commit

Permalink
qemu-check.exp: protect access to $::env(XEN_FFA)
Browse files Browse the repository at this point in the history
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: 4809b4f ("qemu_v8: support for FF-A in Xen")
Signed-off-by: Jerome Forissier <[email protected]>
Reviewed-by: Jens Wiklander <[email protected]>
  • Loading branch information
jforissier committed Jan 3, 2024
1 parent 83fbbd3 commit 45f5619
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion qemu-check.exp
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down

0 comments on commit 45f5619

Please sign in to comment.