[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
06/08: vm: Add ‘cpu-count’ field to <virtual-machine>.
From: |
guix-commits |
Subject: |
06/08: vm: Add ‘cpu-count’ field to <virtual-machine>. |
Date: |
Sat, 10 Feb 2024 17:21:54 -0500 (EST) |
civodul pushed a commit to branch master
in repository guix.
commit b0a5c0742f7e5cf0df4c0f20dbbb720df1311a70
Author: Ludovic Courtès <ludo@gnu.org>
AuthorDate: Sat Jan 20 14:54:34 2024 +0100
vm: Add ‘cpu-count’ field to <virtual-machine>.
* gnu/system/vm.scm (<virtual-machine>)[cpu-count]: New field.
(virtual-machine-compiler): Honor it.
Change-Id: I907a89365f32ac7a9981c4ae5f59cf6eb199c3cc
---
gnu/system/vm.scm | 9 ++++++++-
1 file changed, 8 insertions(+), 1 deletion(-)
diff --git a/gnu/system/vm.scm b/gnu/system/vm.scm
index a95f615e6b..ef4c180058 100644
--- a/gnu/system/vm.scm
+++ b/gnu/system/vm.scm
@@ -75,6 +75,7 @@
virtual-machine?
virtual-machine-operating-system
virtual-machine-qemu
+ virtual-machine-cpu-count
virtual-machine-volatile?
virtual-machine-graphic?
virtual-machine-memory-size
@@ -326,6 +327,8 @@ useful when FULL-BOOT? is true."
(operating-system virtual-machine-operating-system) ;<operating-system>
(qemu virtual-machine-qemu ;<package>
(default qemu-minimal))
+ (cpu-count virtual-machine-cpu-count ;integer
+ (default 1))
(volatile? virtual-machine-volatile? ;Boolean
(default #t))
(graphic? virtual-machine-graphic? ;Boolean
@@ -363,7 +366,7 @@ FORWARDINGS is a list of host-port/guest-port pairs."
(define-gexp-compiler (virtual-machine-compiler (vm <virtual-machine>)
system target)
(match vm
- (($ <virtual-machine> os qemu volatile? graphic? memory-size
+ (($ <virtual-machine> os qemu cpus volatile? graphic? memory-size
disk-image-size forwardings date)
(let ((options
(append (if (null? forwardings)
@@ -372,6 +375,10 @@ FORWARDINGS is a list of host-port/guest-port pairs."
"user,model=virtio-net-pci,"
(port-forwardings->qemu-options
forwardings))))
+ (if (> cpus 1)
+ `("-smp" ,(string-append "cpus="
+ (number->string cpus)))
+ '())
(if date
`("-rtc"
,(string-append
- branch master updated (b64862e5cb -> 9edbb2d7a4), guix-commits, 2024/02/10
- 06/08: vm: Add ‘cpu-count’ field to <virtual-machine>.,
guix-commits <=
- 05/08: vm: Export <virtual-machine> accessors., guix-commits, 2024/02/10
- 03/08: services: secret-service: Make the endpoint configurable., guix-commits, 2024/02/10
- 02/08: gnu: openmolar-1: Update to release 1.1.6-g81838c8 and partial runtime fix., guix-commits, 2024/02/10
- 04/08: vm: Add ‘date’ field to <virtual-machine>., guix-commits, 2024/02/10
- 07/08: marionette: Add #:peek? to ‘wait-for-tcp-port?’., guix-commits, 2024/02/10
- 08/08: services: Add ‘virtual-build-machine’ service., guix-commits, 2024/02/10
- 01/08: gnu: Add python-scikit-opt., guix-commits, 2024/02/10