services: libvirt: Make dmidecode available to fix SMBIOS error.

The libvirt daemon requires 'dmidecode' to provide Host SMBIOS information
to virtual machines. Without it in the PATH, it fails with the error:
"Host SMBIOS information is not available".

* gnu/services/virtualization.scm (libvirt-configuration): Add 'dmidecode'
field to specify the dmidecode package.
(libvirt-service-type): Add dmidecode to system profile to ensure it's
available in PATH.
* doc/guix.texi (Virtualization Services): Document the new 'dmidecode'
option.

Change-Id: I8e5e565e95149c5aeba2dc0c5c757046efa6de2d
This commit is contained in:
Oleg Pykhalov 2025-09-30 03:12:08 +03:00
parent 382b901f24
commit dad7b8d70d
No known key found for this signature in database
GPG key ID: 167F8EA5001AFA9C
2 changed files with 11 additions and 3 deletions

View file

@ -56,7 +56,7 @@ Copyright @copyright{} 2017 Andy Wingo@*
Copyright @copyright{} 2017, 2018, 2019, 2020, 2023, 2024, 2025 Arun Isaac@*
Copyright @copyright{} 2017 nee@*
Copyright @copyright{} 2018 Rutger Helling@*
Copyright @copyright{} 2018, 2021, 2023 Oleg Pykhalov@*
Copyright @copyright{} 2018, 2021, 2023, 2025 Oleg Pykhalov@*
Copyright @copyright{} 2018 Mike Gerwitz@*
Copyright @copyright{} 2018 Pierre-Antoine Rouby@*
Copyright @copyright{} 2018, 2019 Gábor Boskovits@*
@ -39640,6 +39640,9 @@ Libvirt package.
@item @code{qemu} (default: @code{qemu}) (type: file-like)
The QEMU package to use.
@item @code{dmidecode} (default: @code{dmidecode}) (type: file-like)
The Dmidecode package to use.
@item @code{firmwares} (default: @code{(ovmf-x86-64)}) (type: list-of-file-likes)
List of UEFI/BIOS firmware packages to make available. Each firmware
package should contain a @file{share/qemu/firmware/@var{NAME}.json} QEMU

View file

@ -3,7 +3,7 @@
;;; Copyright © 2018, 2020-2025 Ludovic Courtès <ludo@gnu.org>
;;; Copyright © 2020, 2021, 2023, 2024 Janneke Nieuwenhuizen <janneke@gnu.org>
;;; Copyright © 2021 Timotej Lazar <timotej.lazar@araneo.si>
;;; Copyright © 2022 Oleg Pykhalov <go.wigust@gmail.com>
;;; Copyright © 2022, 2025 Oleg Pykhalov <go.wigust@gmail.com>
;;; Copyright © 2022 Leo Nikkilä <hello@lnikki.la>
;;; Copyright © 2023 Efraim Flashner <efraim@flashner.co.il>
;;; Copyright © 2024 Raven Hallsby <karl@hallsby.com>
@ -111,6 +111,7 @@
libvirt-configuration-ca-file
libvirt-configuration-cert-file
libvirt-configuration-crl-file
libvirt-configuration-dmidecode
libvirt-configuration-firmwares
libvirt-configuration-host-uuid
libvirt-configuration-host-uuid-source
@ -220,6 +221,9 @@
(qemu
(file-like qemu)
"The QEMU package to use.")
(dmidecode
(file-like dmidecode)
"The Dmidecode package to use.")
(firmwares
(list-of-file-likes (list ovmf-x86-64))
"List of UEFI/BIOS firmware packages to make available. Each firmware
@ -529,7 +533,8 @@ avoid potential infinite waits blocking libvirt."))
(compose list libvirt-configuration-libvirt))
(service-extension profile-service-type
(lambda (config)
(list (libvirt-configuration-libvirt config)
(list (libvirt-configuration-dmidecode config)
(libvirt-configuration-libvirt config)
(libvirt-configuration-qemu config))))
;; Libvirt only considers the $libvirt/share/qemu/firmware and
;; /etc/qemu/firmware directories to locate the QEMU firmware metadata