summaryrefslogtreecommitdiff
path: root/gnu/system/vm.scm
diff options
context:
space:
mode:
authorEfraim Flashner <efraim@flashner.co.il>2021-04-16 14:39:48 +0300
committerEfraim Flashner <efraim@flashner.co.il>2021-04-16 14:39:48 +0300
commitfcc39864dba82e14895afbe841091091366c96bc (patch)
tree6e0f05495fd6512051224dc85fd3ab495cbf1a24 /gnu/system/vm.scm
parent76fc36d0a7215979bb74c05840f5a4de4ab5ea93 (diff)
parent44f9432705d04c069a8acf9e37e3ad856ac0bf82 (diff)
Merge remote-tracking branch 'origin/master' into core-updates
Conflicts: gnu/local.mk gnu/packages/boost.scm gnu/packages/chez.scm gnu/packages/compression.scm gnu/packages/crates-io.scm gnu/packages/docbook.scm gnu/packages/engineering.scm gnu/packages/gcc.scm gnu/packages/gl.scm gnu/packages/gtk.scm gnu/packages/nettle.scm gnu/packages/python-check.scm gnu/packages/python-xyz.scm gnu/packages/radio.scm gnu/packages/rust.scm gnu/packages/sqlite.scm guix/build-system/node.scm
Diffstat (limited to 'gnu/system/vm.scm')
-rw-r--r--gnu/system/vm.scm20
1 files changed, 16 insertions, 4 deletions
diff --git a/gnu/system/vm.scm b/gnu/system/vm.scm
index db8bc0f49a4..753eb9c8638 100644
--- a/gnu/system/vm.scm
+++ b/gnu/system/vm.scm
@@ -88,6 +88,13 @@
88;;; 88;;;
89;;; Code: 89;;; Code:
90 90
91;; By default, the msize value is 8 KiB, which according to QEMU is
92;; insufficient and would degrade performance. The msize value should roughly
93;; match the bandwidth of the system's IO (see:
94;; https://wiki.qemu.org/Documentation/9psetup#msize). Use 100 MiB as a
95;; conservative default.
96(define %default-msize-value (* 100 (expt 2 20))) ;100 MiB
97
91(define %linux-vm-file-systems 98(define %linux-vm-file-systems
92 ;; File systems mounted for 'derivation-in-linux-vm'. These are shared with 99 ;; File systems mounted for 'derivation-in-linux-vm'. These are shared with
93 ;; the host over 9p. 100 ;; the host over 9p.
@@ -103,21 +110,23 @@
103 (type "9p") 110 (type "9p")
104 (needed-for-boot? #t) 111 (needed-for-boot? #t)
105 (flags '(read-only)) 112 (flags '(read-only))
106 (options "trans=virtio,cache=loose") 113 (options (format #f "trans=virtio,cache=loose,msize=~a"
114 %default-msize-value))
107 (check? #f)) 115 (check? #f))
108 (file-system 116 (file-system
109 (mount-point "/xchg") 117 (mount-point "/xchg")
110 (device "xchg") 118 (device "xchg")
111 (type "9p") 119 (type "9p")
112 (needed-for-boot? #t) 120 (needed-for-boot? #t)
113 (options "trans=virtio") 121 (options (format #f "trans=virtio,msize=~a" %default-msize-value))
114 (check? #f)) 122 (check? #f))
115 (file-system 123 (file-system
116 (mount-point "/tmp") 124 (mount-point "/tmp")
117 (device "tmp") 125 (device "tmp")
118 (type "9p") 126 (type "9p")
119 (needed-for-boot? #t) 127 (needed-for-boot? #t)
120 (options "trans=virtio,cache=loose") 128 (options (format #f "trans=virtio,cache=loose,msize=~a"
129 %default-msize-value))
121 (check? #f)))) 130 (check? #f))))
122 131
123(define not-config? 132(define not-config?
@@ -459,6 +468,7 @@ system that is passed to 'populate-root-file-system'."
459(define* (system-docker-image os 468(define* (system-docker-image os
460 #:key 469 #:key
461 (name "guix-docker-image") 470 (name "guix-docker-image")
471 (memory-size 256)
462 (register-closures? (has-guix-service-type? os)) 472 (register-closures? (has-guix-service-type? os))
463 shared-network?) 473 shared-network?)
464 "Build a docker image. OS is the desired <operating-system>. NAME is the 474 "Build a docker image. OS is the desired <operating-system>. NAME is the
@@ -552,6 +562,7 @@ the operating system."
552 562
553 (expression->derivation-in-linux-vm 563 (expression->derivation-in-linux-vm
554 name build 564 name build
565 #:memory-size memory-size
555 #:make-disk-image? #f 566 #:make-disk-image? #f
556 #:single-file-output? #t 567 #:single-file-output? #t
557 #:references-graphs `((,graph ,os))))) 568 #:references-graphs `((,graph ,os)))))
@@ -581,7 +592,8 @@ the operating system."
581 (type "9p") 592 (type "9p")
582 (flags (if writable? '() '(read-only))) 593 (flags (if writable? '() '(read-only)))
583 (options (string-append "trans=virtio" 594 (options (string-append "trans=virtio"
584 (if writable? "" ",cache=loose"))) 595 (if writable? "" ",cache=loose")
596 ",msize=" (number->string %default-msize-value)))
585 (check? #f) 597 (check? #f)
586 (create-mount-point? #t))))) 598 (create-mount-point? #t)))))
587 599