aboutsummaryrefslogtreecommitdiff
path: root/gnu
diff options
context:
space:
mode:
authorMarius Bakke <mbakke@fastmail.com>2019-12-06 20:53:08 +0100
committerMarius Bakke <mbakke@fastmail.com>2019-12-18 22:36:37 +0100
commit8e53fe2b91d2776bc1529e7b34967c8f1d9edc32 (patch)
tree67a567c116a05ea20de5e51848a8b1e6de66ba77 /gnu
parent7ebf4c40f178449b8ace9a42791baa5e8647124a (diff)
downloadpatches-8e53fe2b91d2776bc1529e7b34967c8f1d9edc32.tar
patches-8e53fe2b91d2776bc1529e7b34967c8f1d9edc32.tar.gz
gnu: Remove uses of deprecated Qemu network configuration.
* gnu/build/vm.scm (load-in-linux-vm): Move Qemu network configuration from ARCH-SPECIFIC-FLAGS to the Qemu command line. Use the "-nic" option of Qemu instead of "-device" and "-net". * gnu/system/vm.scm (common-qemu-options): Do not add a '-net' command. (virtual-machine-compiler): Use "-nic user,..." instead of "-net". * doc/guix.texi (Installing Guix in a VM, Invoking guix system, Running Guix in a VM): Do the same for examples.
Diffstat (limited to 'gnu')
-rw-r--r--gnu/build/vm.scm10
-rw-r--r--gnu/system/vm.scm5
2 files changed, 4 insertions, 11 deletions
diff --git a/gnu/build/vm.scm b/gnu/build/vm.scm
index 89d685b352..9a9e5bd001 100644
--- a/gnu/build/vm.scm
+++ b/gnu/build/vm.scm
@@ -131,14 +131,7 @@ the #:references-graphs parameter of 'derivation'."
;; The serial port name differs between emulated
;; architectures/machines.
" console="
- (if target-arm? "ttyAMA0" "ttyS0"))
-
- ;; NIC is not supported on ARM "virt" machine, so use a user mode
- ;; network stack instead.
- ,@(if target-arm?
- '("-device" "virtio-net-pci,netdev=mynet"
- "-netdev" "user,id=mynet")
- '("-net" "nic,model=virtio"))))
+ (if target-arm? "ttyAMA0" "ttyS0"))))
(when make-disk-image?
(format #t "creating ~a image of ~,2f MiB...~%"
@@ -163,6 +156,7 @@ the #:references-graphs parameter of 'derivation'."
;; CPU with the maximum possible feature set otherwise.
"-cpu" "max"
"-m" (number->string memory-size)
+ "-nic" "user,model=virtio-net-pci"
"-object" "rng-random,filename=/dev/urandom,id=guixsd-vm-rng"
"-device" "virtio-rng-pci,rng=guixsd-vm-rng"
"-virtfs"
diff --git a/gnu/system/vm.scm b/gnu/system/vm.scm
index 8609bd2ace..81b2e06ba2 100644
--- a/gnu/system/vm.scm
+++ b/gnu/system/vm.scm
@@ -927,7 +927,6 @@ with '-virtfs' options for the host file systems listed in SHARED-FS."
'())
"-no-reboot"
- "-net nic,model=virtio"
"-object" "rng-random,filename=/dev/urandom,id=guixsd-vm-rng"
"-device" "virtio-rng-pci,rng=guixsd-vm-rng"
@@ -1046,8 +1045,8 @@ FORWARDINGS is a list of host-port/guest-port pairs."
(($ <virtual-machine> os qemu graphic? memory-size disk-image-size
forwardings)
(let ((options
- `("-net" ,(string-append
- "user,"
+ `("-nic" ,(string-append
+ "user,model=virtio-net-pci,"
(port-forwardings->qemu-options forwardings)))))
(system-qemu-image/shared-store-script os
#:qemu qemu