tests: Allow setting of qemu memory-size for system tests.

* gnu/system/vm.scm (common-qemu-options): Remove hardcoded "-m 256".
(system-qemu-image/shared-store-script): New keyword argument: #:memory-size.
This commit is contained in:
Jan Nieuwenhuizen 2017-06-15 19:22:00 +02:00
parent 0f4c37b9cf
commit ebfb71d456
No known key found for this signature in database
GPG key ID: A12F87978D701B99

View file

@ -489,20 +489,21 @@ (define (virtfs-option fs)
#$@(map virtfs-option shared-fs) #$@(map virtfs-option shared-fs)
"-vga std" "-vga std"
(format #f "-drive file=~a,if=virtio,cache=writeback,werror=report,readonly" (format #f "-drive file=~a,if=virtio,cache=writeback,werror=report,readonly"
#$image) #$image)))
"-m 256"))
(define* (system-qemu-image/shared-store-script os (define* (system-qemu-image/shared-store-script os
#:key #:key
(qemu qemu) (qemu qemu)
(graphic? #t) (graphic? #t)
(memory-size 256)
(mappings '()) (mappings '())
full-boot? full-boot?
(disk-image-size (disk-image-size
(* (if full-boot? 500 70) (* (if full-boot? 500 70)
(expt 2 20)))) (expt 2 20))))
"Return a derivation that builds a script to run a virtual machine image of "Return a derivation that builds a script to run a virtual machine image of
OS that shares its store with the host. OS that shares its store with the host. The virtual machine runs with
MEMORY-SIZE MiB of memory.
MAPPINGS is a list of <file-system-mapping> specifying mapping of host file MAPPINGS is a list of <file-system-mapping> specifying mapping of host file
systems into the guest. systems into the guest.
@ -531,7 +532,8 @@ (define qemu-exec
(string-join #$kernel-arguments " ")))) (string-join #$kernel-arguments " "))))
#$@(common-qemu-options image #$@(common-qemu-options image
(map file-system-mapping-source (map file-system-mapping-source
(cons %store-mapping mappings))))) (cons %store-mapping mappings)))
"-m " (number->string #$memory-size)))
(define builder (define builder
#~(call-with-output-file #$output #~(call-with-output-file #$output