[PATCH 12/13] qsu: follow QEMU_BIN_PATH when QEMU is enabled

Daniel Gomez <[email protected]> Fri, 12 Jun 2026 14:36:50 +0200
Newsgroups dev.linux.lists.kdevops
Message-ID <[email protected]>
From: Daniel Gomez <[email protected]>

QSU_QEMU_BINARY is a prompted string, so once it has a value in .config
it is treated as user-set and its default no longer applies. Enabling
CONFIG_QEMU therefore left it pointing at the previous /usr/bin default
instead of switching to the QEMU the qemu role builds, which surfaces in
menuconfig as the value not updating when QEMU is toggled on.

Hide the prompt when QEMU is set. With the prompt invisible the symbol
takes its default, so it follows QEMU_BIN_PATH and tracks the built
binary dynamically. When QEMU is not set the prompt remains, so a system
or custom QEMU path can still be entered by hand.

Generated-by: Claude AI
Signed-off-by: Daniel Gomez <[email protected]>
---
 kconfigs/Kconfig.qsu     | 15 ++++-----------
 scripts/nixosfi.Makefile |  4 ++++
 2 files changed, 8 insertions(+), 11 deletions(-)

diff --git a/kconfigs/Kconfig.qsu b/kconfigs/Kconfig.qsu
index f4f5f99a..65350ada 100644
--- a/kconfigs/Kconfig.qsu
+++ b/kconfigs/Kconfig.qsu
@@ -14,21 +14,14 @@ config QSU_VARS_DIR
 	  push.
 
 config QSU_QEMU_BINARY
-	string "QEMU system emulator binary"
+	string "QEMU system emulator binary" if !QEMU
 	output yaml
 	default QEMU_BIN_PATH if QEMU
 	default "/usr/bin/qemu-system-x86_64"
 	help
-	  Absolute path to the QEMU system emulator binary for the
-	  guest architecture. The qsu templates invoke this as the
-	  ExecStart= binary path.
-
-	  When QEMU=y, this defaults to QEMU_BIN_PATH so the qsu
-	  service exec'd by systemd is the binary the qemu role just
-	  built and installed, with no manual override needed in the
-	  defconfig. The Jinja2 template resolves at Ansible-use time
-	  so changing the install prefix higher up propagates here
-	  transitively.
+	  Absolute path to the QEMU system emulator binary the qsu unit
+	  execs. When QEMU=y this follows QEMU_BIN_PATH, the binary the qemu
+	  role builds and installs. Otherwise set it to the system QEMU to use.
 
 config QSU_CPU
 	string "Guest CPU model"
diff --git a/scripts/nixosfi.Makefile b/scripts/nixosfi.Makefile
index 9795218b..430c7bfb 100644
--- a/scripts/nixosfi.Makefile
+++ b/scripts/nixosfi.Makefile
@@ -20,6 +20,10 @@ ifeq (y,$(CONFIG_BOOTLINUX_DIRECT_BOOT))
 NIXOSFI_BRINGUP_DEPS += linux-direct-boot
 endif
 
+ifeq (y,$(CONFIG_QEMU))
+NIXOSFI_BRINGUP_DEPS += qemu
+endif
+
 KDEVOPS_PROVISION_METHOD		:= bringup_nixosfi
 KDEVOPS_PROVISION_DESTROY_METHOD	:= destroy_nixosfi
 KDEVOPS_PROVISION_STATUS_METHOD		:= nixosfi-status

-- 
2.54.0