GNU bug report logs - #68677
[PATCH 0/6] Service for "virtual build machines"

Previous Next

Package: guix-patches;

Reported by: Ludovic Courtès <ludo <at> gnu.org>

Date: Tue, 23 Jan 2024 16:47:02 UTC

Severity: normal

Tags: patch

Done: Ludovic Courtès <ludo <at> gnu.org>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: Ludovic Courtès <ludo <at> gnu.org>
To: 68677 <at> debbugs.gnu.org
Cc: Ludovic Courtès <ludo <at> gnu.org>
Subject: [bug#68677] [PATCH 4/6] vm: Add ‘cpu-count’ field to <virtual-machine>.
Date: Tue, 23 Jan 2024 17:48:19 +0100
* 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 @@ (define-module (gnu system vm)
             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 @@ (define-record-type* <virtual-machine> %virtual-machine
   (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 @@ (define (port-forwardings->qemu-options forwardings)
 (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 @@ (define-gexp-compiler (virtual-machine-compiler (vm <virtual-machine>)
                                    "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
-- 
2.41.0





This bug report was last modified 1 year and 154 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.