Qemu installs firmware descriptors in /usr/share/qemu/firmware to be consumed by e.g. libvirt. These descriptors contain the path where to find the actual firmware As of qemu-5.2.0-r1 - potentially earlier - this path is malformed. An excerpt from one of the files: "mapping": { "device": "flash", "executable": { "filename": "share/qemu/edk2-x86_64-secure-code.fd", "format": "raw" }, "nvram-template": { "filename": "share/qemu/edk2-i386-vars.fd", "format": "raw" } } Which should instead be /usr/share/...
Do you want to propose a patch to the ebuild? Ideally in 'git am' form so I could just apply it. It should also illustrate the error clearer.
Created attachment 684681 [details, diff] fix prefix in firmware descriptors To clarify: this bug caused a regression in libvirt - libvirt was no longer able to create new UEFI VMs because the path to the firmware was malformed After doing *some* debugging, it seems to come down to this: in the descriptor files, meson fills out "filename": "@DATADIR@/edk2-x86_64-secure-code.fd" during install. DATADIR is set to qemu_datadir, which in turn is set in the main meson.build to qemu_datadir = get_option('datadir') / get_option('qemu_suffix') however, meson strips 'prefix' from 'datadir' - with prefix being /usr, and datadir being /usr/share, datadir gets stripped to share. The second next line, qemu_moddir, is also affected by this. This seems like an oversight on qemus part, but I'd like someone more knowledgeable with meson to confirm my diagnosis before I report this upstream. Attached is a patch that adds get_option('prefix') / ... to the DATADIR in the descriptor files - I did not want to "fix" qemu_datadir and qemu_moddir in the main meson.build, as their path gets used in various other parts - however I didn't notice any other regressions caused by lack of prefix there.
Aha, it's specifically about firmware/50-edk2-x86_64-secure.json and friends. Posting the contents of /usr/share/qemu/firmware/50-edk2-x86_64-secure.json for posterity: qemu-5.1.0: $ fgrep filename 50-edk2-x86_64-secure.json "filename": "/usr/share/qemu/edk2-x86_64-secure-code.fd", "filename": "/usr/share/qemu/edk2-i386-vars.fd", gemu-5.2.0: $ fgrep filename 50-edk2-x86_64-secure.json "filename": "share/qemu/edk2-x86_64-secure-code.fd", "filename": "share/qemu/edk2-i386-vars.fd",
The bug has been closed via the following commit(s): https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=365cea28d6623c3d7a12623573147d8998cfb314 commit 365cea28d6623c3d7a12623573147d8998cfb314 Author: Sergei Trofimovich <slyfox@gentoo.org> AuthorDate: 2021-01-31 09:37:31 +0000 Commit: Sergei Trofimovich <slyfox@gentoo.org> CommitDate: 2021-01-31 09:37:57 +0000 app-emulation/qemu: fix firmware paths in json files Fixed-by: Jannik Glückert Closes: https://bugs.gentoo.org/766743 Package-Manager: Portage-3.0.14, Repoman-3.0.2 Signed-off-by: Sergei Trofimovich <slyfox@gentoo.org> .../qemu/files/qemu-5.2.0-fix-firmware-path.patch | 16 + app-emulation/qemu/qemu-5.2.0-r2.ebuild | 858 +++++++++++++++++++++ 2 files changed, 874 insertions(+)
(existing) upstream bug: https://bugs.launchpad.net/qemu/+bug/1913012
Proposed your fix upstream as https://lists.gnu.org/archive/html/qemu-devel/2021-01/msg08031.html