From cb8f4405640746293d076d08f6fc486052e2caac Mon Sep 17 00:00:00 2001 From: Kroese Date: Sun, 9 Aug 2026 11:24:49 +0200 Subject: [PATCH] feat: Add QMP configuration variables (#1360) --- docs/environment.md | 2 ++ src/config.sh | 10 +++++++++- 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/docs/environment.md b/docs/environment.md index c96e5b4..604b414 100644 --- a/docs/environment.md +++ b/docs/environment.md @@ -98,3 +98,5 @@ An empty default means the variable is unset and its value is determined automat | `DEBUG` | `N` | Enables verbose debug output. | | `TRACE` | `N` | Enables shell command tracing. | | `HOST_DEBUG` | `N` | Enables debug output for the DSM host helper. | +| `MONITOR` | | QEMU monitor configuration. | +| `QMP` | | QEMU Machine Protocol configuration. | diff --git a/src/config.sh b/src/config.sh index 4c147c5..e21358e 100644 --- a/src/config.sh +++ b/src/config.sh @@ -1,6 +1,9 @@ #!/usr/bin/env bash set -Eeuo pipefail +: "${QMP:=""}" +: "${MONITOR:=""}" + DEF_OPTS="-nodefaults -boot strict=on" DEV_OPTS="" @@ -23,8 +26,13 @@ configureMemory() { configureMonitor() { - MON_OPTS="-name $PROCESS,process=$PROCESS,debug-threads=on" + MON_OPTS="" + [ -n "$QMP" ] && MON_OPTS+=" -qmp $QMP" + [ -n "$MONITOR" ] && MON_OPTS+=" -monitor $MONITOR" + + MON_OPTS+=" -name $PROCESS,process=$PROCESS,debug-threads=on" MON_OPTS+=" -pidfile $QEMU_PID" + MON_OPTS="${MON_OPTS# }" return 0 }