]> git.ipfire.org Git - thirdparty/systemd.git/commit
vmspawn: search XDG_DATA_DIRS for QEMU firmware
authorPaul Meyer <katexochen0@gmail.com>
Wed, 6 May 2026 15:35:48 +0000 (17:35 +0200)
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Thu, 7 May 2026 08:33:01 +0000 (10:33 +0200)
commit67e23e0e050fca0279fc6045de20ed05b0b97bee
treeed68a8b79134e3044daabca81836594572c8e796
parentf0a171d1d8d511bbdc8fd1a5cb9ec2b2b156adbc
vmspawn: search XDG_DATA_DIRS for QEMU firmware

get_firmware_search_dirs() previously hardcoded /usr/share/qemu/firmware
as the only system-wide search path. That assumption breaks on
distributions that deliberately do not populate /usr/share, making
vmspawn fail: "Failed to find OVMF config: No such file or directory".
NixOS exposes those firmware locations through XDG_DATA_DIRS.

Extend the search list with XDG_DATA_HOME/XDG_DATA_DIRS. This is the
standard XDG mechanism and is already what QEMU itself uses for the same
descriptors, so behavior matches user expectations across tooling.

To avoid regressing setups where user has set XDG_DATA_DIRS to a custom
value that omits /usr/share, keep /usr/share/qemu/firmware as an
unconditional fallback.

Precedence is unchanged: XDG_CONFIG_HOME/qemu/firmware still wins
over /etc/qemu/firmware, which still wins over any shared-data dir.

Co-developed-by: Claude Opus 4.7 <noreply@anthropic.com>
Signed-off-by: Paul Meyer <katexochen0@gmail.com>
src/vmspawn/vmspawn-util.c