From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp10.migadu.com ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms0.migadu.com with LMTPS id aLoTONOoB2J/GgEAgWs5BA (envelope-from ) for ; Sat, 12 Feb 2022 13:32:19 +0100 Received: from aspmx1.migadu.com ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp10.migadu.com with LMTPS id 8CbHMNOoB2IqgwEAG6o9tA (envelope-from ) for ; Sat, 12 Feb 2022 13:32:19 +0100 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id 4FF523095B for ; Sat, 12 Feb 2022 13:32:19 +0100 (CET) Received: from localhost ([::1]:42762 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nIrZZ-0005Pj-Vx for larch@yhetil.org; Sat, 12 Feb 2022 07:32:18 -0500 Received: from eggs.gnu.org ([209.51.188.92]:43046) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nIrYN-0005PM-5I for bug-guix@gnu.org; Sat, 12 Feb 2022 07:31:03 -0500 Received: from debbugs.gnu.org ([209.51.188.43]:39786) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1nIrYM-0001b9-NU for bug-guix@gnu.org; Sat, 12 Feb 2022 07:31:02 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1nIrYM-00049Z-Fp for bug-guix@gnu.org; Sat, 12 Feb 2022 07:31:02 -0500 X-Loop: help-debbugs@gnu.org Subject: bug#53921: [PATCH] services: libvirt: Enable listening mode based on configuration. References: <8735kq8x86.fsf@gmail.com> In-Reply-To: <8735kq8x86.fsf@gmail.com> Resent-From: Brice Waegeneire Original-Sender: "Debbugs-submit" Resent-CC: bug-guix@gnu.org Resent-Date: Sat, 12 Feb 2022 12:31:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 53921 X-GNU-PR-Package: guix X-GNU-PR-Keywords: To: cox.katherine.e@gmail.com Received: via spool by 53921-submit@debbugs.gnu.org id=B53921.164466904314656 (code B ref 53921); Sat, 12 Feb 2022 12:31:02 +0000 Received: (at 53921) by debbugs.gnu.org; 12 Feb 2022 12:30:43 +0000 Received: from localhost ([127.0.0.1]:33683 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nIrY2-0003nw-Is for submit@debbugs.gnu.org; Sat, 12 Feb 2022 07:30:43 -0500 Received: from relay1-d.mail.gandi.net ([217.70.183.193]:41949) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nIrY0-0003e7-BJ for 53921@debbugs.gnu.org; Sat, 12 Feb 2022 07:30:41 -0500 Received: (Authenticated sender: brice@waegenei.re) by mail.gandi.net (Postfix) with ESMTPSA id 5BCC0240009; Sat, 12 Feb 2022 12:30:33 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=waegenei.re; s=gm1; t=1644669033; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=pFlYNhMAWLanA6ire5qib5V8fLCinpdudJoj18yzkNM=; b=nZULQiP7IafQZg25Q4fxyy1vMaaTBbFk1LNlUjgQl1kZzBQX+7/Om7DdJ4F+fXsHvKIEhO CDUEMmGyC7DF/ns61fqa9zvUYpB5vKAqMXvtmopyGrAxuBl/pTy3sLYu2Gfk+CPw4c6MTX thwTad/ASc0mVf/yCCrrwwSrpB9xavGAZvWZGiRliRVIrVKpVHOXrJF9ZRrGtRYHEQS7rK ZKfG87pmi9dO572mhxsHSa7wYZSZ5M22DpftUSIqzFAokjyvBv6U6m3qyRoem8t+KI6EOQ BLC8MyrTcUYSOFekpxRPn4VhfMNhMSD2+/Jc4KCCS3beG8Q9sCHizX98bjnpng== From: Brice Waegeneire Date: Sat, 12 Feb 2022 13:30:28 +0100 Message-Id: <20220212123028.6320-1-brice@waegenei.re> X-Mailer: git-send-email 2.34.0 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-guix@gnu.org List-Id: Bug reports for GNU Guix List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: 53921@debbugs.gnu.org Errors-To: bug-guix-bounces+larch=yhetil.org@gnu.org Sender: "bug-Guix" X-Migadu-Flow: FLOW_IN X-Migadu-Country: US ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1644669139; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding:resent-cc: resent-from:resent-sender:resent-message-id:in-reply-to:in-reply-to: references:references:list-id:list-help:list-unsubscribe: list-subscribe:list-post:dkim-signature; bh=pFlYNhMAWLanA6ire5qib5V8fLCinpdudJoj18yzkNM=; b=s7h9diCAezFxoBlBFC3Sa3KdQvp+VJXxahPzOeYx+hWiIR9eXOlwit/5XGsWqTR2/DRont 2pqS9MDnEhM5zbVcZ1c98IfN4g+DoUv8UiQtUZ3Qx9xgMrTlXRy92vasDcRRqCcRdmzbvb MmPcYhxPMr6j7gKrrW8RQ7N03HRBYTR2OJ3fvcd/4BFMu1Nee7U9suV0Wn7tTzzEB+t0p/ fRzwonOQlZzxvvRyHk2AXehk4d2bfEKLs6jvDcTCGQKR7pVMavTcu8vHAtJwFgVon363vH aU6FC2f7Qb2FupogXwRHvPnN8JSiL1sKSrFAGOs+xuZcD9NK9uISwecM4cAFRA== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1644669139; a=rsa-sha256; cv=none; b=JDHGs4D19NzNCXsgJdzP+xbWTukLhtyyBangtL02hd+Sit1ffZE74uFgAS+DWl6vyXRQKS KMrNKM7TLQn1IZ5xvgAmf+i0BWkbl3jK4qxjS9ENWg51omYkSwszjJvErPUUW3YpjNi4oR rAttZ+XLRxKsKl8j6lNzeQZaK2SI6g0VZd4b7B3PgvIfwt79DTe4K+TPpFac6oU9dMsqEE gh73FYtTpjTrZDCZkdkcRmKOZT6Ax6cQmgxNJ7tqpwuiFqcIqLxnrGuA61ji9Wa/Edx86a vWWe1yznL5F98eEisLsjhH8ZR2g+7h9JtWEtGgyDHvbgwehEr9m9gvaIOYkE2g== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=waegenei.re header.s=gm1 header.b=nZULQiP7; dmarc=none; spf=pass (aspmx1.migadu.com: domain of "bug-guix-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="bug-guix-bounces+larch=yhetil.org@gnu.org" X-Migadu-Spam-Score: -1.93 Authentication-Results: aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=waegenei.re header.s=gm1 header.b=nZULQiP7; dmarc=none; spf=pass (aspmx1.migadu.com: domain of "bug-guix-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="bug-guix-bounces+larch=yhetil.org@gnu.org" X-Migadu-Queue-Id: 4FF523095B X-Spam-Score: -1.93 X-Migadu-Scanner: scn0.migadu.com X-TUID: kNq7lOyE7Rf9 Fixes . * 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 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 ;;; Copyright © 2020,2021 Jan (janneke) Nieuwenhuizen ;;; Copyright © 2021 Timotej Lazar +;;; Copyright © 2022 Brice Waegeneire ;;; ;;; 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 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