From a5dd055ea0fc20420cca6df2d38302596d397c49 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Miguel=20=C3=81ngel=20Arruga=20Vivas?= Date: Sun, 27 Oct 2019 03:56:17 +0100 Subject: [PATCH 1/2] services: libvirtd: Create required control groups. * gnu/services/virtualization.scm (libvirt-shepherd-service) [libvirtd-activation]: New shepherd service. [libvirtd]: Add a requirement of the new service. --- gnu/services/virtualization.scm | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/gnu/services/virtualization.scm b/gnu/services/virtualization.scm index bc8ac9b40a..2f26945efd 100644 --- a/gnu/services/virtualization.scm +++ b/gnu/services/virtualization.scm @@ -428,8 +428,19 @@ potential infinite waits blocking libvirt.")) (let* ((config-file (libvirt-conf-file config)) (libvirt (libvirt-configuration-libvirt config))) (list (shepherd-service + ;; See https://libvirt.org/cgroups.html#currentLayoutGeneric + (documentation "Create the cgroup hierarchy required by libvirt.") + (provision '(libvirtd-activation)) + (requirement '(file-system-/sys/fs/cgroup)) + (one-shot? #t) + (start #~(lambda args + (let ((path "/sys/fs/cgroup/unified/machine")) + (or (access? path F_OK) (mkdir path))))) + (stop #~(lambda args #t))) + (shepherd-service (documentation "Run the libvirt daemon.") (provision '(libvirtd)) + (requirement '(libvirtd-activation)) (start #~(make-forkexec-constructor (list (string-append #$libvirt "/sbin/libvirtd") "-f" #$config-file) -- 2.23.0