diff mbox series

[bug#69899,1/2] vm: override %CURRENT-SYSTEM to always use a native emulator.

Message ID 4d858dc7d62800138c0d8fd78c598c9a89044662.1713194805.git.zhengjunjie@iscas.ac.cn
State New
Headers show
Series [bug#69899,1/2] vm: override %CURRENT-SYSTEM to always use a native emulator. | expand

Commit Message

Zheng Junjie April 15, 2024, 3:33 p.m. UTC
From: Ludovic Courtès <ludo@gnu.org>

* gnu/system/vm.scm (system-qemu-image/shared-store-script): override
%CURRENT-SYSTEM to always use a native emulator.

Change-Id: Ia2cb7cca33eec018d810bd00d0208b58392ea483
---
 gnu/system/vm.scm | 11 ++++++++---
 1 file changed, 8 insertions(+), 3 deletions(-)


base-commit: 6b3c90f638292f9604a221ac6dbf22234f6e4c4b
diff mbox series

Patch

diff --git a/gnu/system/vm.scm b/gnu/system/vm.scm
index 7d9d07ebb7..2d1a4a9df1 100644
--- a/gnu/system/vm.scm
+++ b/gnu/system/vm.scm
@@ -287,8 +287,11 @@  (define* (system-qemu-image/shared-store-script os
       #~(format #f "/tmp/guix-image-~a" (basename #$base-image)))
 
     (define qemu-exec
-      #~(list #+(file-append qemu "/bin/"
-                             (qemu-command (or target system)))
+      #~(list #+(with-parameters ((%current-system %system)
+                                  (%current-target-system #f))
+                  ;; Override %CURRENT-SYSTEM to always use a native emulator.
+                  (file-append qemu "/bin/"
+                               (qemu-command (or target system))))
               ;; Tells qemu to use the terminal it was started in for IO.
               #$@(if graphic? '() #~("-nographic"))
               #$@(if full-boot?
@@ -325,7 +328,9 @@  (define* (system-qemu-image/shared-store-script os
       #~(call-with-output-file #$output
           (lambda (port)
             (format port "#!~a~%"
-                    #+(file-append bash "/bin/sh"))
+                    #+(with-parameters ((%current-system %system)
+                                        (%current-target-system #f))
+                        (file-append bash "/bin/sh")))
             #$@(if volatile?
                    #~()
                    #~((format port "~a~%" #+copy-image)))