GNU bug report logs - #53921
The libvirt service does not contain a way to turn-on remote listening

Previous Next

Package: guix;

Reported by: Katherine Cox-Buday <cox.katherine.e <at> gmail.com>

Date: Thu, 10 Feb 2022 17:10:01 UTC

Severity: normal

To reply to this bug, email your comments to 53921 AT debbugs.gnu.org.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-guix <at> gnu.org:
bug#53921; Package guix. (Thu, 10 Feb 2022 17:10:01 GMT) Full text and rfc822 format available.

Acknowledgement sent to Katherine Cox-Buday <cox.katherine.e <at> gmail.com>:
New bug report received and forwarded. Copy sent to bug-guix <at> gnu.org. (Thu, 10 Feb 2022 17:10:01 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Katherine Cox-Buday <cox.katherine.e <at> gmail.com>
To: Guix Bugs <bug-guix <at> gnu.org>
Subject: The libvirt service does not contain a way to turn-on remote listening
Date: Thu, 10 Feb 2022 11:09:29 -0600
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:

> You must set listen for this to have any effect. 

From libvirt's documentation[2]:

> Note: it is also necessary to start the server in listening mode by
> running it with --listen or adding a LIBVIRTD_ARGS="--listen" line to
> /etc/sysconfig/libvirtd.

Our service definition requires the ability to specify that shepherd should start the service with the `--listen` flag.

[1] - https://guix.gnu.org/manual/en/guix.html#index-listen_002dtcp_003f
[2] - https://libvirt.org/remote.html#Remote_libvirtd_configuration

-- 
Katherine




Information forwarded to bug-guix <at> gnu.org:
bug#53921; Package guix. (Sat, 12 Feb 2022 12:31:02 GMT) Full text and rfc822 format available.

Message #8 received at 53921 <at> debbugs.gnu.org (full text, mbox):

From: Brice Waegeneire <brice <at> waegenei.re>
To: cox.katherine.e <at> gmail.com
Cc: 53921 <at> debbugs.gnu.org
Subject: [PATCH] services: libvirt: Enable listening mode based on
 configuration.
Date: Sat, 12 Feb 2022 13:30:28 +0100
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 <at> 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 <at> gnu.org>
 ;;; Copyright © 2020,2021 Jan (janneke) Nieuwenhuizen <janneke <at> gnu.org>
 ;;; Copyright © 2021 Timotej Lazar <timotej.lazar <at> araneo.si>
+;;; Copyright © 2022 Brice Waegeneire <brice <at> 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





Information forwarded to bug-guix <at> gnu.org:
bug#53921; Package guix. (Sat, 12 Feb 2022 15:57:01 GMT) Full text and rfc822 format available.

Message #11 received at 53921 <at> debbugs.gnu.org (full text, mbox):

From: Katherine Cox-Buday <cox.katherine.e <at> gmail.com>
To: Brice Waegeneire <brice <at> waegenei.re>
Cc: 53921 <at> debbugs.gnu.org
Subject: Re: [PATCH] services: libvirt: Enable listening mode based on
 configuration.
Date: Sat, 12 Feb 2022 09:56:39 -0600
Brice Waegeneire <brice <at> waegenei.re> writes:

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

Thanks, Brice! This looks great!

-- 
Katherine




This bug report was last modified 2 years and 80 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.