summary refs log tree commit diff
diff options
context:
space:
mode:
authorOleg Pykhalov <go.wigust@gmail.com>2022-09-09 23:48:44 +0300
committerOleg Pykhalov <go.wigust@gmail.com>2022-09-09 23:50:55 +0300
commit8eeadc8cb8dce9b918ffe5048758936d2bf1ebd6 (patch)
treeaff4d00ae506a01340e677f3c5e1f4d62dff6421
parente08b1669b46c8ada015f7f82e68399d57fc4f0d2 (diff)
downloadguix-8eeadc8cb8dce9b918ffe5048758936d2bf1ebd6.tar.gz
services: libvirt: Fix listen TCP.
* gnu/services/virtualization.scm (libvirt-shepherd-service): Add '--listen'
argument if 'listen-tcp?' is true.
-rw-r--r--gnu/services/virtualization.scm7
1 files changed, 5 insertions, 2 deletions
diff --git a/gnu/services/virtualization.scm b/gnu/services/virtualization.scm
index 406752b35c..8b480e1bd3 100644
--- a/gnu/services/virtualization.scm
+++ b/gnu/services/virtualization.scm
@@ -3,6 +3,7 @@
 ;;; Copyright © 2018, 2020-2022 Ludovic Courtès <ludo@gnu.org>
 ;;; Copyright © 2020,2021 Jan (janneke) Nieuwenhuizen <janneke@gnu.org>
 ;;; Copyright © 2021 Timotej Lazar <timotej.lazar@araneo.si>
+;;; Copyright © 2022 Oleg Pykhalov <go.wigust@gmail.com>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -470,13 +471,15 @@ potential infinite waits blocking libvirt."))
 
 (define (libvirt-shepherd-service config)
   (let* ((config-file (libvirt-conf-file config))
-         (libvirt (libvirt-configuration-libvirt config)))
+         (libvirt (libvirt-configuration-libvirt config))
+         (listen-tcp? (libvirt-configuration-listen-tcp? config)))
     (list (shepherd-service
            (documentation "Run the libvirt daemon.")
            (provision '(libvirtd))
            (start #~(make-forkexec-constructor
                      (list (string-append #$libvirt "/sbin/libvirtd")
-                           "-f" #$config-file)
+                           "-f" #$config-file
+                           #$@(if listen-tcp? '("--listen") '()))
                      ;; For finding qemu and ip binaries.
                      #:environment-variables
                      (list (string-append