From a9270c1261b747dc9a82b52d1ce38314862c51cd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ludovic=20Court=C3=A8s?= Date: Wed, 27 May 2020 23:09:49 +0200 Subject: [PATCH 5/7] vm: compiler honors system and target. * gnu/system/vm.scm (system-qemu-image/shared-store): Add #:system and #:target. Pass it down. (system-qemu-image/shared-store-script): Likewise. (virtual-machine-compiler): Likewise. --- gnu/system/vm.scm | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/gnu/system/vm.scm b/gnu/system/vm.scm index 991ea2d837..05f3986aca 100644 --- a/gnu/system/vm.scm +++ b/gnu/system/vm.scm @@ -764,6 +764,8 @@ environment with the store shared with the host. MAPPINGS is a list of (define* (system-qemu-image/shared-store os #:key + (system (%current-system)) + (target (%current-target-system)) full-boot? (disk-image-size (* (if full-boot? 500 30) (expt 2 20)))) "Return a derivation that builds a QEMU image of OS that shares its store @@ -784,6 +786,8 @@ bootloader refers to: OS kernel, initrd, bootloader data, etc." ;; This is more than needed (we only need the kernel, initrd, GRUB for its ;; font, and the background image), but it's hard to filter that. (qemu-image #:os os + #:system system + #:target target #:bootcfg-drv bootcfg #:bootloader (bootloader-configuration-bootloader (operating-system-bootloader os)) @@ -824,6 +828,8 @@ with '-virtfs' options for the host file systems listed in SHARED-FS." (define* (system-qemu-image/shared-store-script os #:key + (system (%current-system)) + (target (%current-target-system)) (qemu qemu) (graphic? #t) (memory-size 256) @@ -847,6 +853,8 @@ it is mostly useful when FULL-BOOT? is true." (mlet* %store-monad ((os -> (virtualized-operating-system os mappings full-boot?)) (image (system-qemu-image/shared-store os + #:system system + #:target target #:full-boot? full-boot? #:disk-image-size disk-image-size))) (define kernel-arguments @@ -920,10 +928,11 @@ FORWARDINGS is a list of host-port/guest-port pairs." (define-gexp-compiler (virtual-machine-compiler (vm ) system target) - ;; XXX: SYSTEM and TARGET are ignored. (match vm (($ os qemu graphic? memory-size disk-image-size ()) (system-qemu-image/shared-store-script os + #:system system + #:target target #:qemu qemu #:graphic? graphic? #:memory-size memory-size @@ -936,6 +945,8 @@ FORWARDINGS is a list of host-port/guest-port pairs." "user,model=virtio-net-pci," (port-forwardings->qemu-options forwardings))))) (system-qemu-image/shared-store-script os + #:system system + #:target target #:qemu qemu #:graphic? graphic? #:memory-size memory-size -- 2.26.2