unofficial mirror of bug-guix@gnu.org 
 help / color / mirror / code / Atom feed
* bug#53921: The libvirt service does not contain a way to turn-on remote listening
@ 2022-02-10 17:09 Katherine Cox-Buday
  2022-02-12 12:30 ` bug#53921: [PATCH] services: libvirt: Enable listening mode based on configuration Brice Waegeneire
  0 siblings, 1 reply; 3+ messages in thread
From: Katherine Cox-Buday @ 2022-02-10 17:09 UTC (permalink / raw)
  To: 53921

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




^ permalink raw reply	[flat|nested] 3+ messages in thread

* bug#53921: [PATCH] services: libvirt: Enable listening mode based on configuration.
  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
  2022-02-12 15:56   ` Katherine Cox-Buday
  0 siblings, 1 reply; 3+ messages in thread
From: Brice Waegeneire @ 2022-02-12 12:30 UTC (permalink / raw)
  To: cox.katherine.e; +Cc: 53921

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





^ permalink raw reply related	[flat|nested] 3+ messages in thread

* bug#53921: [PATCH] services: libvirt: Enable listening mode based on configuration.
  2022-02-12 12:30 ` bug#53921: [PATCH] services: libvirt: Enable listening mode based on configuration Brice Waegeneire
@ 2022-02-12 15:56   ` Katherine Cox-Buday
  0 siblings, 0 replies; 3+ messages in thread
From: Katherine Cox-Buday @ 2022-02-12 15:56 UTC (permalink / raw)
  To: Brice Waegeneire; +Cc: 53921

Brice Waegeneire <brice@waegenei.re> writes:

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

Thanks, Brice! This looks great!

-- 
Katherine




^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2022-02-12 15:57 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
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 ` bug#53921: [PATCH] services: libvirt: Enable listening mode based on configuration Brice Waegeneire
2022-02-12 15:56   ` Katherine Cox-Buday

Code repositories for project(s) associated with this public inbox

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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).