all messages for Guix-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Brice Waegeneire <brice@waegenei.re>
To: cox.katherine.e@gmail.com
Cc: 53921@debbugs.gnu.org
Subject: bug#53921: [PATCH] services: libvirt: Enable listening mode based on configuration.
Date: Sat, 12 Feb 2022 13:30:28 +0100	[thread overview]
Message-ID: <20220212123028.6320-1-brice@waegenei.re> (raw)
In-Reply-To: <8735kq8x86.fsf@gmail.com>

Fixes <https://bugs.gnu.org/53921>.

* gnu/services/virtualization.scm (libvirt-shepherd-service): Use
  'match-record' instead of accessors.
  Conditionally add "--listen" flag to the start command.
---
Hello Katherine,

Katherine Cox-Buday <cox.katherine.e@gmail.com> writes:

> The shepherd libvirt service contains ways to configure "listening mode"
> (i.e. listening over TCP) capabilities, but contains no way to actually turn
> this feature on, despite referencing[1] an unimplemented `listen` option:

Good catch!  This patch fixes the reported issue, I've tested it with success.

Cheers,
- Brice

 gnu/services/virtualization.scm | 13 ++++++++-----
 1 file changed, 8 insertions(+), 5 deletions(-)

diff --git a/gnu/services/virtualization.scm b/gnu/services/virtualization.scm
index 66ae1a1565..ba9fe0505c 100644
--- a/gnu/services/virtualization.scm
+++ b/gnu/services/virtualization.scm
@@ -3,6 +3,7 @@
 ;;; Copyright © 2018, 2020, 2021 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 Brice Waegeneire <brice@waegenei.re>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -467,16 +468,18 @@ (define (%libvirt-activation config)
         (use-modules (guix build utils))
         (mkdir-p #$sock-dir))))
 
-
 (define (libvirt-shepherd-service config)
-  (let* ((config-file (libvirt-conf-file config))
-         (libvirt (libvirt-configuration-libvirt config)))
+  (match-record config <libvirt-configuration>
+    (libvirt listen-tcp? listen-tls?)
     (list (shepherd-service
            (documentation "Run the libvirt daemon.")
            (provision '(libvirtd))
            (start #~(make-forkexec-constructor
-                     (list (string-append #$libvirt "/sbin/libvirtd")
-                           "-f" #$config-file)
+                     (list #$(file-append libvirt "/sbin/libvirtd")
+                           (if (or #$listen-tcp? #$listen-tls?)
+                               "--listen"
+                               "")
+                           "-f" #$(libvirt-conf-file config))
                      ;; For finding qemu and ip binaries.
                      #:environment-variables
                      (list (string-append

base-commit: 068d99978a0c9c6fb66f95455060c8d08ba55ac5
-- 
2.34.0





  reply	other threads:[~2022-02-12 12:32 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-02-10 17:09 bug#53921: The libvirt service does not contain a way to turn-on remote listening Katherine Cox-Buday
2022-02-12 12:30 ` Brice Waegeneire [this message]
2022-02-12 15:56   ` bug#53921: [PATCH] services: libvirt: Enable listening mode based on configuration Katherine Cox-Buday

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20220212123028.6320-1-brice@waegenei.re \
    --to=brice@waegenei.re \
    --cc=53921@debbugs.gnu.org \
    --cc=cox.katherine.e@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/guix.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.