mirror of
https://codeberg.org/guix/guix.git
synced 2026-01-25 03:55:08 -06:00
services: libvirt: Add configurable service requirements.
This enhances flexibility by allowing users to specify custom service dependencies for libvirt, rather than being limited to the default hardcoded requirements. This is particularly useful for complex deployments or when integrating with custom service configurations. Note that default 'dbus-system' requirement may not be strictly necessary for basic libvirt operation. For instance, libvirt can function without issues in many cases even when dbus-system is not included in the requirements, allowing for more minimal deployments. * gnu/services/virtualization.scm (list-of-symbols?, serialize-list-of-symbols): New procedures. (libvirt-configuration): Add 'requirement' field to allow custom service dependencies. (libvirt-shepherd-service): Use the configured requirements instead of hardcoded ones. * doc/guix.texi (Virtualization Services): Document the new 'requirement' option. Change-Id: I05cfbb5227cff9b7d9b55ee37774c96e39c4c526
This commit is contained in:
parent
dad7b8d70d
commit
0824f8a3eb
2 changed files with 14 additions and 1 deletions
|
|
@ -39643,6 +39643,9 @@ The QEMU package to use.
|
|||
@item @code{dmidecode} (default: @code{dmidecode}) (type: file-like)
|
||||
The Dmidecode package to use.
|
||||
|
||||
@item @code{requirement} (default: @code{'()}) (type: list-of-symbols)
|
||||
Shepherd services dependencies to the provisioned Shepherd service.
|
||||
|
||||
@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
|
||||
|
|
|
|||
|
|
@ -135,6 +135,7 @@
|
|||
libvirt-configuration-ovs-timeout
|
||||
libvirt-configuration-prio-workers
|
||||
libvirt-configuration-qemu
|
||||
libvirt-configuration-requirement
|
||||
libvirt-configuration-sasl-allowed-usernames
|
||||
libvirt-configuration-tcp-port
|
||||
libvirt-configuration-tls-allowed-dn-list
|
||||
|
|
@ -214,6 +215,12 @@
|
|||
(define list-of-file-likes?
|
||||
(list-of file-like?))
|
||||
|
||||
(define list-of-symbols?
|
||||
(list-of symbol?))
|
||||
|
||||
(define (serialize-list-of-symbols field-name val)
|
||||
val)
|
||||
|
||||
(define-configuration libvirt-configuration
|
||||
(libvirt
|
||||
(file-like libvirt)
|
||||
|
|
@ -224,6 +231,9 @@
|
|||
(dmidecode
|
||||
(file-like dmidecode)
|
||||
"The Dmidecode package to use.")
|
||||
(requirement
|
||||
(list-of-symbols '(dbus-system))
|
||||
"Shepherd services dependencies to the provisioned Shepherd service.")
|
||||
(firmwares
|
||||
(list-of-file-likes (list ovmf-x86-64))
|
||||
"List of UEFI/BIOS firmware packages to make available. Each firmware
|
||||
|
|
@ -495,7 +505,7 @@ avoid potential infinite waits blocking libvirt."))
|
|||
(list (shepherd-service
|
||||
(documentation "Run the libvirt daemon.")
|
||||
(provision '(libvirtd))
|
||||
(requirement '(dbus-system))
|
||||
(requirement (libvirt-configuration-requirement config))
|
||||
(start #~(make-forkexec-constructor
|
||||
(list (string-append #$libvirt "/sbin/libvirtd")
|
||||
"-f" #$config-file
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue