From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp2 ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms11 with LMTPS id AHMUEGs9WV+SbgAA0tVLHw (envelope-from ) for ; Wed, 09 Sep 2020 20:39:07 +0000 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp2 with LMTPS id 4BN+C2s9WV92DAAAB5/wlQ (envelope-from ) for ; Wed, 09 Sep 2020 20:39:07 +0000 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 BB0CA9401D0 for ; Wed, 9 Sep 2020 20:39:06 +0000 (UTC) Received: from localhost ([::1]:33688 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kG6rx-00012T-Hv for larch@yhetil.org; Wed, 09 Sep 2020 16:39:05 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:54880) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kG6ru-00012M-6Q for guix-patches@gnu.org; Wed, 09 Sep 2020 16:39:02 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:51562) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1kG6rt-0005y7-TY for guix-patches@gnu.org; Wed, 09 Sep 2020 16:39:01 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1kG6rt-0007hm-RO for guix-patches@gnu.org; Wed, 09 Sep 2020 16:39:01 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#41143] [PATCH 1/2] mapped-devices: Allow target to be list of strings Resent-From: Ludovic =?UTF-8?Q?Court=C3=A8s?= Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Wed, 09 Sep 2020 20:39:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 41143 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: tsmish Cc: 41143@debbugs.gnu.org Received: via spool by 41143-submit@debbugs.gnu.org id=B41143.159968393129601 (code B ref 41143); Wed, 09 Sep 2020 20:39:01 +0000 Received: (at 41143) by debbugs.gnu.org; 9 Sep 2020 20:38:51 +0000 Received: from localhost ([127.0.0.1]:34875 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kG6ri-0007hN-UC for submit@debbugs.gnu.org; Wed, 09 Sep 2020 16:38:51 -0400 Received: from eggs.gnu.org ([209.51.188.92]:44712) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kG6re-0007h7-Gu for 41143@debbugs.gnu.org; Wed, 09 Sep 2020 16:38:49 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]:43550) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kG6rZ-0005uu-73; Wed, 09 Sep 2020 16:38:41 -0400 Received: from [2a01:e0a:1d:7270:af76:b9b:ca24:c465] (port=55676 helo=ribbon) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1kG6rY-0000YA-Pr; Wed, 09 Sep 2020 16:38:41 -0400 From: Ludovic =?UTF-8?Q?Court=C3=A8s?= References: Date: Wed, 09 Sep 2020 22:38:34 +0200 In-Reply-To: (tsmish's message of "Sat, 9 May 2020 01:12:43 +0000") Message-ID: <874ko6n0s5.fsf@gnu.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.3 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Score: -2.3 (--) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-Spam-Score: -3.3 (---) X-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+larch=yhetil.org@gnu.org Sender: "Guix-patches" X-Scanner: scn0 Authentication-Results: aspmx1.migadu.com; dkim=none; dmarc=none; spf=pass (aspmx1.migadu.com: domain of guix-patches-bounces@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=guix-patches-bounces@gnu.org X-Spam-Score: -1.01 X-TUID: Lq/90YlvrIls Hi Mikhail, Sorry for the very late reply! Vacations came by, and by now this entry is at the bottom of the patch tracker. :-) People repeatedly ask for LVM support, so I guess you=E2=80=99ll make them = all happy! Great you got it into shape. tsmish skribis: > (let ...) stuff should be in function, but I don't know in which > module it should go. > Code is somewhat untested, proceed with caution. > > --- > gnu/services/base.scm | 5 ++++- > gnu/system.scm | 13 ++++++++----- > gnu/system/mapped-devices.scm | 2 +- > 3 files changed, 13 insertions(+), 7 deletions(-) Side note: We=E2=80=99ll a commit log that follows our conventions=C2=B9 bu= t that=E2=80=99s something I can help with. =C2=B9 https://guix.gnu.org/manual/en/html_node/Submitting-Patches.html > diff --git a/gnu/services/base.scm b/gnu/services/base.scm > index 0c154d1c4e..3d09e8220c 100644 > --- a/gnu/services/base.scm > +++ b/gnu/services/base.scm > @@ -408,7 +408,10 @@ FILE-SYSTEM." > (define (mapped-device->shepherd-service-name md) > "Return the symbol that denotes the shepherd service of MD, a > ." > (symbol-append 'device-mapping- > - (string->symbol (mapped-device-target md)))) > + (string->symbol (string-join > + (let ((t (mapped-device-target md))) > + (if (list? t) t (list t))) > + "-")))) To avoid duplicating the (if (list? t) =E2=80=A6) everywhere, I propose ins= tead the following approach: 1. Rename =E2=80=98target=E2=80=99 to =E2=80=98targets=E2=80=99 (plural) = and likewise for the accessor, and agree that it always contains a list; 2. Rename =E2=80=98mapped-device=E2=80=99 to =E2=80=98%mapped-device=E2= =80=99 and add a =E2=80=98mapped-device=E2=80=99 backward-compatibility macro that allo= ws for a =E2=80=98target=E2=80=99 (singular) field and automatically turns its = value into a list. See the =E2=80=98origin=E2=80=99 macro in (guix packages) for a= n example of how to do that (that macro allows users to specify =E2=80=98sha256=E2= =80=99 instead of =E2=80=98hash=E2=80=99). 3. Add a deprecated =E2=80=98mapped-device-target=E2=80=99 (singular) tha= t returns the first element returned by =E2=80=98mapped-device-targets=E2=80=99. We=E2=80=99ll need to adjust doc/guix.texi accordingly. How does that sound? Thanks, Ludo=E2=80=99.