From 0c75a4de497991912af0e4d252b90c283e162e5d Mon Sep 17 00:00:00 2001 From: Christopher Baines Date: Thu, 28 Sep 2017 18:57:09 +0100 Subject: vm: Add a minimum root size. * gnu/system/vm.scm (qemu-image): When guessing the root-size, use a lower bound of 20 MiB, otherwise the root file system size is sometimes 0 MiB in size. --- gnu/system/vm.scm | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'gnu/system') diff --git a/gnu/system/vm.scm b/gnu/system/vm.scm index 78143e4f7a..d340a8563f 100644 --- a/gnu/system/vm.scm +++ b/gnu/system/vm.scm @@ -304,9 +304,12 @@ the image." #:register-closures? #$register-closures? #:system-directory #$os-drv)) (root-size #$(if (eq? 'guess disk-image-size) - #~(estimated-partition-size - (map (cut string-append "/xchg/" <>) - graphs)) + #~(max + ;; Minimum 20 MiB root size + (* 20 (expt 2 20)) + (estimated-partition-size + (map (cut string-append "/xchg/" <>) + graphs))) (- disk-image-size (* 50 (expt 2 20))))) (partitions (list (partition -- cgit v1.2.3 From eb152070f1598769390a294e6d33f902b2d7be2b Mon Sep 17 00:00:00 2001 From: Christopher Baines Date: Thu, 28 Sep 2017 18:57:18 +0100 Subject: vm: Add disk-image-size to . * gnu/system/vm.scm (): Add disk-image-size. (port-forwardings->qemu-options): Use disk-image-size from . --- gnu/system/vm.scm | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) (limited to 'gnu/system') diff --git a/gnu/system/vm.scm b/gnu/system/vm.scm index d340a8563f..273a895bef 100644 --- a/gnu/system/vm.scm +++ b/gnu/system/vm.scm @@ -709,6 +709,8 @@ it is mostly useful when FULL-BOOT? is true." (default #f)) (memory-size virtual-machine-memory-size ;integer (MiB) (default 256)) + (disk-image-size virtual-machine-disk-image-size ;integer (bytes) + (default 'guess)) (port-forwardings virtual-machine-port-forwardings ;list of integer pairs (default '()))) @@ -737,12 +739,15 @@ FORWARDINGS is a list of host-port/guest-port pairs." system target) ;; XXX: SYSTEM and TARGET are ignored. (match vm - (($ os qemu graphic? memory-size ()) + (($ os qemu graphic? memory-size disk-image-size ()) (system-qemu-image/shared-store-script os #:qemu qemu #:graphic? graphic? - #:memory-size memory-size)) - (($ os qemu graphic? memory-size forwardings) + #:memory-size memory-size + #:disk-image-size + disk-image-size)) + (($ os qemu graphic? memory-size disk-image-size + forwardings) (let ((options `("-net" ,(string-append "user," @@ -751,6 +756,8 @@ FORWARDINGS is a list of host-port/guest-port pairs." #:qemu qemu #:graphic? graphic? #:memory-size memory-size + #:disk-image-size + disk-image-size #:options options))))) ;;; vm.scm ends here -- cgit v1.2.3