GNU bug report logs - #76488
[PATCH 0/4] Test installation on Debian

Previous Next

Package: guix-patches;

Reported by: Ludovic Courtès <ludo <at> gnu.org>

Date: Sat, 22 Feb 2025 17:09:02 UTC

Severity: normal

Tags: patch

Done: Ludovic Courtès <ludo <at> gnu.org>

Bug is archived. No further changes may be made.

Full log


Message #8 received at 76488 <at> debbugs.gnu.org (full text, mbox):

From: Ludovic Courtès <ludo <at> gnu.org>
To: 76488 <at> debbugs.gnu.org
Cc: Ludovic Courtès <ludo <at> gnu.org>
Subject: [PATCH 2/4] vm: ‘common-qemu-options’ splits command-line tokens.
Date: Sat, 22 Feb 2025 18:10:14 +0100
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 <ludo <at> gnu.org>
+;;; Copyright © 2013-2025 Ludovic Courtès <ludo <at> gnu.org>
 ;;; Copyright © 2016 Christine Lemmer-Webber <cwebber <at> dustycloud.org>
 ;;; Copyright © 2016, 2017 Leo Famulari <leo <at> famulari.name>
 ;;; Copyright © 2017 Mathieu Othacehe <m.othacehe <at> gmail.com>
@@ -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
-- 
2.48.1





This bug report was last modified 79 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.