From patchwork Fri Dec 6 21:13:04 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Marius Bakke X-Patchwork-Id: 16406 Return-Path: X-Original-To: patchwork@mira.cbaines.net Delivered-To: patchwork@mira.cbaines.net Received: by mira.cbaines.net (Postfix, from userid 113) id 864021785E; Fri, 6 Dec 2019 21:14:16 +0000 (GMT) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,FREEMAIL_FROM, T_DKIM_INVALID autolearn=unavailable autolearn_force=no version=3.4.0 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mira.cbaines.net (Postfix) with ESMTP id 3CC771785C for ; Fri, 6 Dec 2019 21:14:16 +0000 (GMT) Received: from localhost ([::1]:45412 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1idKvX-0004tt-KV for patchwork@mira.cbaines.net; Fri, 06 Dec 2019 16:14:15 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:57891) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1idKvR-0004sx-Dp for guix-patches@gnu.org; Fri, 06 Dec 2019 16:14:10 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1idKvP-0005sG-8b for guix-patches@gnu.org; Fri, 06 Dec 2019 16:14:09 -0500 Received: from debbugs.gnu.org ([209.51.188.43]:41139) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1idKvK-0005qg-P5 for guix-patches@gnu.org; Fri, 06 Dec 2019 16:14:03 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1idKvK-0001D5-JZ for guix-patches@gnu.org; Fri, 06 Dec 2019 16:14:02 -0500 X-Loop: help-debbugs@gnu.org Subject: [bug#38513] [PATCH] gnu: Remove uses of deprecated Qemu "-nic, model=foo" invokations. Resent-From: Marius Bakke Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Fri, 06 Dec 2019 21:14:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 38513 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 38513@debbugs.gnu.org X-Debbugs-Original-To: guix-patches@gnu.org Received: via spool by submit@debbugs.gnu.org id=B.15756667954588 (code B ref -1); Fri, 06 Dec 2019 21:14:02 +0000 Received: (at submit) by debbugs.gnu.org; 6 Dec 2019 21:13:15 +0000 Received: from localhost ([127.0.0.1]:47112 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1idKuZ-0001Bw-5P for submit@debbugs.gnu.org; Fri, 06 Dec 2019 16:13:15 -0500 Received: from lists.gnu.org ([209.51.188.17]:39642) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1idKuX-0001Bo-3O for submit@debbugs.gnu.org; Fri, 06 Dec 2019 16:13:13 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:54347) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1idKuV-0004eC-Ky for guix-patches@gnu.org; Fri, 06 Dec 2019 16:13:12 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1idKuU-0003R2-7e for guix-patches@gnu.org; Fri, 06 Dec 2019 16:13:11 -0500 Received: from out3-smtp.messagingengine.com ([66.111.4.27]:56035) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1idKuT-0003FB-Oh for guix-patches@gnu.org; Fri, 06 Dec 2019 16:13:10 -0500 Received: from compute5.internal (compute5.nyi.internal [10.202.2.45]) by mailout.nyi.internal (Postfix) with ESMTP id 3481822860 for ; Fri, 6 Dec 2019 16:13:07 -0500 (EST) Received: from mailfrontend2 ([10.202.2.163]) by compute5.internal (MEProxy); Fri, 06 Dec 2019 16:13:07 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=fastmail.com; h= from:to:subject:date:message-id:mime-version :content-transfer-encoding; s=fm1; bh=1Da1B1N4rq77gPfHBdye/pMvX5 9cTL4/qnOhPF+iBRk=; b=V3OHaU9QdOnJunxqNw+4NbraytrdX0KLi/OiaV8qwR ALYe+Gth859sJEHr2156/wHKaWIdGDI4SH1yvUjP4XpmKkYdtgM7VMy+lfASE/ZD XEkv4bNul9g5xDv4I2MGgxSHpyq5DoLldZyGkZYnRXQZlqeRaPt5T+kcGB5Nsjmw hMfKgf1Lankx03VxL68r5A7WflfU30743TxDnDrqVDU0ISyqoeB6SnCYGsqmrp7y muPuhg2qqwEiaXX8B4Pr/vYHf9PfmUiCm015b5SMmSP4RMyRsmTKwA8bT1JI9f7f FzspW7YzaMCE8G83+AOft9ALpmqLpOQhcLKLa8QTEeHw== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=content-transfer-encoding:date:from :message-id:mime-version:subject:to:x-me-proxy:x-me-proxy :x-me-sender:x-me-sender:x-sasl-enc; s=fm1; bh=1Da1B1N4rq77gPfHB dye/pMvX59cTL4/qnOhPF+iBRk=; b=fXwRitG6bsBt04uIDnlJ+649k9eOaHrg1 ZbaIRtqKeC3J4J3ulH8XQ0Xj008Q4XE5vlVNwi0p9/+lgvXXRhheFhUpziRe+h3T wPJmI5y7Vwb8j+L9OKFP0iWUkI8IYuRlFXn/bSA2Z5DVdCVYs5I9iAhtDZTWxNi0 TP0bb9kdagsAJO/VOZd1mS0bqmKu+jZa9oUQT88OfydHYptH5AIsqxdxPOB7Lu0/ oDLFw2d7C33yCYBbLUrcffpMi0yLrMg6duK7plWmTbVHXaen5MsiM1qZEC+GMZrV vMMw7LbsshG8/PltVp/BO4Oo0/eawxJOKq6KJmOE/2iMG6aGAnMkg== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedufedrudekfedgudegvdcutefuodetggdotefrod ftvfcurfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfgh necuuegrihhlohhuthemuceftddtnecunecujfgurhephffvufffkffoggfgsedtkeertd ertddtnecuhfhrohhmpeforghrihhushcuuegrkhhkvgcuoehmsggrkhhkvgesfhgrshht mhgrihhlrdgtohhmqeenucfkphepiedvrdduiedrudelvddrudehtdenucfrrghrrghmpe hmrghilhhfrhhomhepmhgsrghkkhgvsehfrghsthhmrghilhdrtghomhenucevlhhushht vghrufhiiigvpedt X-ME-Proxy: Received: from localhost (ti0006q161-0149.bb.online.no [62.16.192.150]) by mail.messagingengine.com (Postfix) with ESMTPA id B6DA530600AB for ; Fri, 6 Dec 2019 16:13:06 -0500 (EST) From: Marius Bakke Date: Fri, 6 Dec 2019 22:13:04 +0100 Message-Id: <20191206211304.2724-1-mbakke@fastmail.com> X-Mailer: git-send-email 2.24.0 MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 209.51.188.43 X-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org Sender: "Guix-patches" X-getmail-retrieved-from-mailbox: Patches * 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): Change "-net nic ..." to "-nic user ...". * doc/guix.texi (Installing Guix in a VM, Running Guix in a VM): Adjust examples accordingly. --- doc/guix.texi | 16 +++++++--------- gnu/build/vm.scm | 10 ++-------- gnu/system/vm.scm | 2 +- 3 files changed, 10 insertions(+), 18 deletions(-) diff --git a/doc/guix.texi b/doc/guix.texi index 7d50f31d20..31f26694fd 100644 --- a/doc/guix.texi +++ b/doc/guix.texi @@ -46,7 +46,7 @@ Copyright @copyright{} 2017, 2018 Carlo Zancanaro@* Copyright @copyright{} 2017 Thomas Danckaert@* Copyright @copyright{} 2017 humanitiesNerd@* Copyright @copyright{} 2017 Christopher Allan Webber@* -Copyright @copyright{} 2017, 2018 Marius Bakke@* +Copyright @copyright{} 2017, 2018, 2019 Marius Bakke@* Copyright @copyright{} 2017, 2019 Hartmut Goebel@* Copyright @copyright{} 2017, 2019 Maxim Cournoyer@* Copyright @copyright{} 2017, 2018, 2019 Tobias Geerinckx-Rice@* @@ -2472,7 +2472,7 @@ Boot the USB installation image in an VM: @example qemu-system-x86_64 -m 1024 -smp 1 -enable-kvm \ - -net user -net nic,model=virtio -boot menu=on,order=d \ + -nic user,model=virtio-net-pci -boot menu=on,order=d \ -drive file=guix-system.img \ -drive media=cdrom,file=guix-system-install-@value{VERSION}.@var{system}.iso @end example @@ -26514,7 +26514,7 @@ vm-image} on x86_64 hardware: @example $ qemu-system-x86_64 \ - -net user -net nic,model=virtio \ + -nic user,model=virtio-net-pci \ -enable-kvm -m 1024 \ -device virtio-blk,drive=myhd \ -drive if=none,file=/tmp/qemu-image,id=myhd @@ -26527,14 +26527,12 @@ Here is what each of these options means: This specifies the hardware platform to emulate. This should match the host. -@item -net user +@item -nic user,model=virtio-net-pci Enable the unprivileged user-mode network stack. The guest OS can access the host but not vice versa. This is the simplest way to get the -guest OS online. - -@item -net nic,model=virtio -You must create a network interface of a given model. If you do not -create a NIC, the boot will fail. Assuming your hardware platform is +guest OS online. @code{model} specifies which network device to emulate: +@code{virtio-net-pci} is a special device made for virtualized operating +systems and recommended for most uses. Assuming your hardware platform is x86_64, you can get a list of available NIC models by running @command{qemu-system-x86_64 -net nic,model=help}. 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..5ee9855ae5 100644 --- a/gnu/system/vm.scm +++ b/gnu/system/vm.scm @@ -927,7 +927,7 @@ with '-virtfs' options for the host file systems listed in SHARED-FS." '()) "-no-reboot" - "-net nic,model=virtio" + "-nic" "user,model=virtio-net-pci" "-object" "rng-random,filename=/dev/urandom,id=guixsd-vm-rng" "-device" "virtio-rng-pci,rng=guixsd-vm-rng"