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 mEo9Jjoj715ITwAA0tVLHw (envelope-from ) for ; Sun, 21 Jun 2020 09:07:06 +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 6JkVIjoj715MVgAAB5/wlQ (envelope-from ) for ; Sun, 21 Jun 2020 09:07:06 +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 220AE94053B for ; Sun, 21 Jun 2020 09:07:06 +0000 (UTC) Received: from localhost ([::1]:53536 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jmvwP-00067S-39 for larch@yhetil.org; Sun, 21 Jun 2020 05:07:05 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:46452) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jmvwM-000678-25 for guix-patches@gnu.org; Sun, 21 Jun 2020 05:07:02 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:47655) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1jmvwL-0006Z4-OK for guix-patches@gnu.org; Sun, 21 Jun 2020 05:07:01 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1jmvwL-0007aL-IQ for guix-patches@gnu.org; Sun, 21 Jun 2020 05:07:01 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#41961] [PATCH 1/1] services: childhurd: Support more than one instance. Resent-From: Jan Nieuwenhuizen Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Sun, 21 Jun 2020 09:07:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 41961 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: Mathieu Othacehe Cc: rekado@elephly.net, 41961@debbugs.gnu.org Received: via spool by 41961-submit@debbugs.gnu.org id=B41961.159273041329143 (code B ref 41961); Sun, 21 Jun 2020 09:07:01 +0000 Received: (at 41961) by debbugs.gnu.org; 21 Jun 2020 09:06:53 +0000 Received: from localhost ([127.0.0.1]:59201 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jmvwD-0007Zz-Dh for submit@debbugs.gnu.org; Sun, 21 Jun 2020 05:06:53 -0400 Received: from eggs.gnu.org ([209.51.188.92]:60300) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jmvwB-0007Zm-VD for 41961@debbugs.gnu.org; Sun, 21 Jun 2020 05:06:52 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]:51017) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jmvw6-0006UJ-HI; Sun, 21 Jun 2020 05:06:46 -0400 Received: from [2001:980:1b4f:1:42d2:832d:bb59:862] (port=34178 helo=dundal.peder.onsbrabantnet.nl) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1jmvw4-0004Jv-8Y; Sun, 21 Jun 2020 05:06:45 -0400 From: Jan Nieuwenhuizen Organization: AvatarAcademy.nl References: <20200620091656.6804-1-janneke@gnu.org> <20200620091918.6868-1-janneke@gnu.org> <87366o6chl.fsf@gnu.org> X-Url: http://AvatarAcademy.nl Date: Sun, 21 Jun 2020 11:06:41 +0200 In-Reply-To: <87366o6chl.fsf@gnu.org> (Mathieu Othacehe's message of "Sun, 21 Jun 2020 10:37:26 +0200") Message-ID: <875zbk3hzy.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: /WWHIP4Dh3fN Mathieu Othacehe writes: Hey Mathieu, >> * gnu/services/virtualization.scm ()[id,net-optio= ns]: >> New fields. >> (hurd-vm-net-options): New prodecure. Parameterize port forwarding with= ID. > ^ > typo Oops, thanks. >> +@item @code{options} (default: @code{'("--snapshot" "--hda")}) >> The extra options for running QEMU. > > Does it really make sense to have "--hda" standalone here, without a > specific image argument? Hmm...yes, this looked a bit awkward to me too. It's being used like this: o--8<---------------cut here---------------start------------->8--- (let ((image (hurd-vm-configuration-image config)) ...) (define vm-command #~(list (string-append #$qemu "/bin/qemu-system-i386") #$@(if (file-exists? "/dev/kvm") '("--enable-kvm") '()) "-m" (number->string #$memory-size) #$@net-options #$@options #+image)) --8<---------------cut here---------------end--------------->8--- so that you can play with options and image; have the "hurd-vm-configuration-image" procedure to return anything, something that may require something else than --hda ...but it's quite implicit. Ideas? >> + (net-options hurd-vm-configuration-net-options ;list of string >> + (thunked) >> + (default (hurd-vm-net-options this-record)))) > > Why does it need to be thunked? It uses ID from the configuration like so --8<---------------cut here---------------start------------->8--- (define (hurd-vm-net-options config) (let ((id (or (hurd-vm-configuration-id config) 0))) (define (qemu-vm-port base) (number->string (+ base (* 1000 id)))) [...] ",hostfwd=3Dtcp:127.0.0.1:" (qemu-vm-port 10022) "-:2222" [...])) --8<---------------cut here---------------end--------------->8--- to fix parameterize the ports for QEMU. Is there a better way to do that? > Otherwise this looks nice! Great, thanks! Greetigs, Janneke --=20 Jan Nieuwenhuizen | GNU LilyPond http://lilypond.org Freelance IT http://JoyofSource.com | Avatar=C2=AE http://AvatarAcademy.com