-
-
Notifications
You must be signed in to change notification settings - Fork 582
Description
Description
In Quickemu v4.9.7, the internal variable QEMU_VER_SHORT is not properly initialized, which leads to a crash when the startup script attempts to use it.
This appears to happen because the QEMU_VER_LONG string sometimes contains extra characters (e.g., parentheses) that break the intended parsing.
Steps to Reproduce
- Install or run Quickemu v4.9.7
- Run any virtual machine startup (e.g.
quickemu --vm void-20250202-xfce-glibc.conf) - Observe the crash with an error referencing
QEMU_VER_SHORTor malformed QEMU version output.
Expected Behavior
The script should initialize QEMU_VER_SHORT correctly and continue launching the VM without crashing.
Actual Behavior
The script fails to initialize properly and crashes early due to an invalid or empty QEMU_VER_SHORT value.
Root Cause
The current line in the startup script:
QEMU_VER_SHORT=$(echo "${QEMU_VER_LONG%.*}" | sed 's/\.//g')does not handle cases where QEMU_VER_LONG includes parentheses (e.g. 2.12.0(v2.12.0-19097-g85fa07f04ef)).
Proposed Fix
I tested the following change, which resolves the issue:
QEMU_VER_SHORT=$(echo "${QEMU_VER_LONG%.*}" | sed 's/\.//g' | cut -d '(' -f 1)This trims any parenthetical content from the version string before further processing.
Environment
- Quickemu version: 4.9.7
- Host OS: Fedora 43
- QEMU version: qemu-10.1.2-1.fc43
- Shell: bash
Additional Notes
After applying the fix, Quickemu runs as expected and VMs launch normally.
It might be worth sanitizing QEMU_VER_LONG more generally to handle future version formatting variations.