From patchwork Mon Feb 24 12:45:49 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Ludovic_Court=C3=A8s?= X-Patchwork-Id: 39108 Return-Path: X-Original-To: patchwork@mira.cbaines.net Delivered-To: patchwork@mira.cbaines.net Received: by mira.cbaines.net (Postfix, from userid 113) id 3CA8727BBEA; Mon, 24 Feb 2025 12:47:24 +0000 (GMT) X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-7.6 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_BLOCKED, RCVD_IN_VALIDITY_CERTIFIED,RCVD_IN_VALIDITY_RPBL,RCVD_IN_VALIDITY_SAFE, SPF_HELO_PASS,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mira.cbaines.net (Postfix) with ESMTPS id 9586C27BBE2 for ; Mon, 24 Feb 2025 12:47:23 +0000 (GMT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tmXri-0002YI-LI; Mon, 24 Feb 2025 07:47:19 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1tmXrd-0002SI-5Q for guix-patches@gnu.org; Mon, 24 Feb 2025 07:47:15 -0500 Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tmXrS-0000ns-VH for guix-patches@gnu.org; Mon, 24 Feb 2025 07:47:05 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=debbugs.gnu.org; s=debbugs-gnu-org; h=MIME-Version:References:In-Reply-To:Date:From:To:Subject; bh=A6wC3vciTBAN1uMxnw0N4tNrObQQoeWqJP6ukYw2HbU=; b=Z31uuZLEMCT7cLyXWY4adnKbrriLJhaqtuSc2bIPhKFABShcyj9rOVN5Mk9/JbCMls99M7f6dyWxnyULOi65f2wcguIetjtglK32t/Z348ypDkEWOhQv/sJFdwUnTzhmP2bfBms1oiTQ/akw5/hXEpL8GITLeMR+08yzyemrKu/YzIFO55PuKhYVvWMDqk2uDy4UhSFUqK9uFMI1E5/z2ca8bVn00HlnPibLCHGvEXIrAoiK0HbA3cYtSH5kkgL3f+I29Te1jYGXqZnFOQ9SuaRYXgu+6y+x/ILrhKOwuYxMOJ7yG8ivQrwAaeF4bBlBa/p6KsdKiiTc0s7XtG850g==; Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1tmXrS-00041H-R8 for guix-patches@gnu.org; Mon, 24 Feb 2025 07:47:02 -0500 X-Loop: help-debbugs@gnu.org Subject: [bug#76488] [PATCH v2 2/4] vm: =?utf-8?b?4oCYY29tbW9uLXFlbXUtb3B0?= =?utf-8?b?aW9uc+KAmQ==?= splits command-line tokens. Resent-From: Ludovic =?utf-8?q?Court=C3=A8s?= Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Mon, 24 Feb 2025 12:47:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 76488 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 76488@debbugs.gnu.org Cc: Ludovic =?utf-8?q?Court=C3=A8s?= Received: via spool by 76488-submit@debbugs.gnu.org id=B76488.174040119015366 (code B ref 76488); Mon, 24 Feb 2025 12:47:02 +0000 Received: (at 76488) by debbugs.gnu.org; 24 Feb 2025 12:46:30 +0000 Received: from localhost ([127.0.0.1]:38860 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tmXqv-0003zk-Iy for submit@debbugs.gnu.org; Mon, 24 Feb 2025 07:46:29 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:32998) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1tmXqt-0003z0-5Y for 76488@debbugs.gnu.org; Mon, 24 Feb 2025 07:46:27 -0500 Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1tmXqh-0000kc-53; Mon, 24 Feb 2025 07:46:21 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-Version:References:In-Reply-To:Date:Subject:To: From; bh=A6wC3vciTBAN1uMxnw0N4tNrObQQoeWqJP6ukYw2HbU=; b=al9/v4Pl0Sh0Sl05LQFa HVeriPRoFe+SAanjDPXZ07IKk6mRy6MEmfPnQmjfyORNg/VQHxK+XRMq6LaTkypBtene5MSq87Uxj 74aDqoUG7uCGN+gZmSgIngiDhaG/gSv/LdaLUskiTt8OkqTtV1qkdeT151zHnHKGTxIl3aMTUrsGR yySXcVeHrMlXclxT0j2zbD7im6S/9+TbGGmI9bFGr6eJ1acHkDA/rDoOIMHvfh054Yz2CbmI8hKGI eg/FPtTWOazqBNykpLbx91A/aHJv/efLwRNN30s0+dJda/2Zr3mSsBjiPtGoF9fC/GIDKbJ0h4Xjv zKrWm52kjt+Y5g==; From: Ludovic =?utf-8?q?Court=C3=A8s?= Date: Mon, 24 Feb 2025 13:45:49 +0100 Message-ID: <70d3a086aeed2da038467f6c4670e51b61f29cc6.1740400981.git.ludo@gnu.org> X-Mailer: git-send-email 2.48.1 In-Reply-To: References: MIME-Version: 1.0 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org Sender: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org X-getmail-retrieved-from-mailbox: Patches The result returned so far by ‘common-qemu-options’ assumed that it would be passed to a shell. This is the case when using ‘system-qemu-image/shared-store-script’ but possibly not in other cases. * gnu/system/vm.scm (common-qemu-options): Add #:image-format. [virtfs-option]: Return a list of strings instead of a single "-virtfs xyz" string. Update caller to use ‘append-map’. Separate "-drive" string. Change-Id: Ib07c27e2c4b2d222d7db2c612bb045d330bc7f68 --- gnu/system/vm.scm | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/gnu/system/vm.scm b/gnu/system/vm.scm index 1e3f72c7b2a..dbfe873e4f5 100644 --- a/gnu/system/vm.scm +++ b/gnu/system/vm.scm @@ -1,5 +1,5 @@ ;;; GNU Guix --- Functional package management for GNU -;;; Copyright © 2013-2024 Ludovic Courtès +;;; Copyright © 2013-2025 Ludovic Courtès ;;; Copyright © 2016 Christine Lemmer-Webber ;;; Copyright © 2016, 2017 Leo Famulari ;;; Copyright © 2017 Mathieu Othacehe @@ -211,14 +211,16 @@ (define* (virtualized-operating-system os (define* (common-qemu-options image shared-fs #:key + (image-format "raw") rw-image? (target (%current-target-system))) "Return the a string-value gexp with the common QEMU options to boot IMAGE, with '-virtfs' options for the host file systems listed in SHARED-FS." (define (virtfs-option fs) - #~(format #f "-virtfs local,path=~s,security_model=none,mount_tag=~s" - #$fs #$(file-system->mount-tag fs))) + #~("-virtfs" + (format #f "local,path=~a,security_model=none,mount_tag=~a" + #$fs #$(file-system->mount-tag fs)))) #~(;; Only enable kvm if we see /dev/kvm exists. ;; This allows users without hardware virtualization to still use these @@ -230,11 +232,12 @@ (define* (common-qemu-options image shared-fs "-object" "rng-random,filename=/dev/urandom,id=guix-vm-rng" "-device" "virtio-rng-pci,rng=guix-vm-rng" - #$@(map virtfs-option shared-fs) - #$@(if rw-image? - #~((format #f "-drive file=~a,format=qcow2,if=virtio" #$image)) - #~((format #f "-drive file=~a,format=raw,if=virtio,cache=writeback,werror=report,readonly=on" - #$image))))) + #$@(append-map virtfs-option shared-fs) + "-drive" + #$(if rw-image? + #~(format #f "file=~a,format=qcow2,if=virtio" #$image) + #~(format #f "file=~a,format=~a,if=virtio,cache=writeback,werror=report,readonly=on" + #$image #$image-format)))) (define* (system-qemu-image/shared-store-script os #:key