From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp0 ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms0.migadu.com with LMTPS id UPqSNvdmeWGwHQAAgWs5BA (envelope-from ) for ; Wed, 27 Oct 2021 16:49:27 +0200 Received: from aspmx1.migadu.com ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp0 with LMTPS id MFBmMvdmeWGpfQAA1q6Kng (envelope-from ) for ; Wed, 27 Oct 2021 14:49:27 +0000 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id 8C4DA36393 for ; Wed, 27 Oct 2021 16:49:27 +0200 (CEST) Received: from localhost ([::1]:50650 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mfkF4-0007Ov-MJ for larch@yhetil.org; Wed, 27 Oct 2021 10:49:26 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:43162) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mfjXB-0008Pe-9g for guix-patches@gnu.org; Wed, 27 Oct 2021 10:04:05 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:38547) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mfjXB-0005Go-0p for guix-patches@gnu.org; Wed, 27 Oct 2021 10:04:05 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1mfjXA-0002Zc-RZ for guix-patches@gnu.org; Wed, 27 Oct 2021 10:04:04 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#51440] [PATCH 08/10] services: Define '%qemu-static-networking'. Resent-From: Ludovic =?UTF-8?Q?Court=C3=A8s?= Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Wed, 27 Oct 2021 14:04:04 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 51440 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 51440@debbugs.gnu.org Cc: Ludovic =?UTF-8?Q?Court=C3=A8s?= Received: via spool by 51440-submit@debbugs.gnu.org id=B51440.16353434019756 (code B ref 51440); Wed, 27 Oct 2021 14:04:04 +0000 Received: (at 51440) by debbugs.gnu.org; 27 Oct 2021 14:03:21 +0000 Received: from localhost ([127.0.0.1]:50082 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mfjWS-0002XB-Dz for submit@debbugs.gnu.org; Wed, 27 Oct 2021 10:03:20 -0400 Received: from eggs.gnu.org ([209.51.188.92]:45572) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mfjWL-0002W0-IM for 51440@debbugs.gnu.org; Wed, 27 Oct 2021 10:03:13 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]:37978) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mfjWG-00058Y-Ax; Wed, 27 Oct 2021 10:03:08 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-Version:References:In-Reply-To:Date:Subject:To: From; bh=NfHER5O+rtp5vUNrP/FtzUi2KACgFi9EmcB/+QS6z+0=; b=Q9DJd5RXi2MlebTEjLQZ nwkBDpruYg3uDtbFXnk1DbaewZiJbQiystcVbXG7JGTPYENlQfnBeYw3ODnzzGn+F2+xM8rVjvFQT w5I2NDGnDp62Pya00d5bSE+FEwSAxWF4aCH2R1JjPxFeFZBZu4wb/o7aLIInNMnY1/1w/SC1xWujS SRO/BLwqgjZn1Cv2yvJo+s0YFgZjJr85CUQ7JxowAkl79WzjpBF+lFbBJGQmR/hOGBSTDCRazku4G EcFxAZI1Ko1rBgvDniqWmHKFWzN3Z392PUvzvEcfq8NmWvHnieEAjxLfxZvZ/UDZzYuygiBO3swrv N95/Zhse36GEGw==; Received: from [2a01:e0a:1d:7270:af76:b9b:ca24:c465] (port=55004 helo=gnu.org) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mfjWF-0002Tf-37; Wed, 27 Oct 2021 10:03:08 -0400 From: Ludovic =?UTF-8?Q?Court=C3=A8s?= Date: Wed, 27 Oct 2021 16:02:43 +0200 Message-Id: <20211027140245.18970-8-ludo@gnu.org> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20211027140245.18970-1-ludo@gnu.org> References: <20211027140245.18970-1-ludo@gnu.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+larch=yhetil.org@gnu.org Sender: "Guix-patches" X-Migadu-Flow: FLOW_IN ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1635346167; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding:resent-cc: resent-from:resent-sender:resent-message-id:in-reply-to:in-reply-to: references:references:list-id:list-help:list-unsubscribe: list-subscribe:list-post:dkim-signature; bh=KnRor4Rv3SCKpmZxC842RB13PCt9b2AizyjWl4cY04I=; b=IfhGicKEeO6YOFndIBEjmv/f2R+jAM/yXWtaNlcFAk6q0sRDLid/mq1N0EfqbTyHlw28jW kfDxyJoNLIqCTyGfrO5Cu/sDvRUIrtTRUiF3vJpT6WfNFIiVIP+6O0KfTNZF3M+FyWcGL2 MsBC1qjZSqq81lsoiFB2WvnJDAEZHou/as07vxAIV0vziwIW69akWnyVHexFxLSkszncaC scAcLPjy/fmd1CCM+qP4hXafOo9p0/MZF7yo5NPp3IascuQSp207pGUyVYwGd+3xiaupqT 5E2h1GT23GrRSKaDv8CFK2X8jngDpaNd5xThyzbDrl7TtwPNolePswC1/JiPjw== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1635346167; a=rsa-sha256; cv=none; b=rapbLlXA6k2oIBX/rSwNSRoYr7uPLPr8E7rmr7hm6Y8+tzfhL7o0z0kvAAHx9c6Y2KGixk NBWbm6wt8aSf1M99n1UGKuqLL5OaplaDN+jh1TkDlnWEDAbvcImfdUHfyVXejW3WcdRk2T F7ciEKQg+BOAGgp9QmvIAI2oeUczj2xumJGgOGvDkrJYIo1eADHwsuh2P3CXGlkcwwgtol u7g9owyTGE8TOJIhlL98Ca5UifLpa+Xim3nnJ7WOrLtkfFTPC19n+2D9FvtJyDqYXMVrUd Cp4BddIQI3JZefBtXw3/ZuBMCc0YIzAGivGKqudOAzs92DClBMdYsPw+CAbnyA== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=fail ("body hash did not verify") header.d=gnu.org header.s=fencepost-gnu-org header.b=Q9DJd5RX; spf=pass (aspmx1.migadu.com: domain of guix-patches-bounces@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=guix-patches-bounces@gnu.org X-Migadu-Spam-Score: 3.57 Authentication-Results: aspmx1.migadu.com; dkim=fail ("body hash did not verify") header.d=gnu.org header.s=fencepost-gnu-org header.b=Q9DJd5RX; dmarc=pass (policy=none) header.from=gnu.org; spf=pass (aspmx1.migadu.com: domain of guix-patches-bounces@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=guix-patches-bounces@gnu.org X-Migadu-Queue-Id: 8C4DA36393 X-Spam-Score: 3.57 X-Migadu-Scanner: scn0.migadu.com X-TUID: o+7RfXU9j6+X * gnu/services/base.scm (%qemu-static-networking): New variable. * gnu/system/hurd.scm (%base-services/hurd): Use it. * doc/guix.texi (Networking Setup): Document it. --- doc/guix.texi | 8 ++++++++ gnu/services/base.scm | 16 ++++++++++++++++ gnu/system/hurd.scm | 21 ++++++--------------- 3 files changed, 30 insertions(+), 15 deletions(-) diff --git a/doc/guix.texi b/doc/guix.texi index b529a8db6c..0b23075d8c 100644 --- a/doc/guix.texi +++ b/doc/guix.texi @@ -16923,6 +16923,14 @@ List of arguments for this type of link. @end table @end deftp +@cindex networking, with QEMU +@cindex QEMU, networking +@defvr {Scheme Variable} %qemu-static-networking +This is the @code{static-networking} record representing network setup +when using QEMU's user-mode network stack on @code{eth0} (@pxref{Using +the user mode network stack,,, QEMU, QEMU Documentation}). +@end defvr + @cindex DHCP, networking service @defvr {Scheme Variable} dhcp-client-service-type This is the type of services that run @var{dhcp}, a Dynamic Host Configuration diff --git a/gnu/services/base.scm b/gnu/services/base.scm index 03f6b388a8..380be1c71e 100644 --- a/gnu/services/base.scm +++ b/gnu/services/base.scm @@ -113,6 +113,8 @@ (define-module (gnu services base) static-networking-service static-networking-service-type + %qemu-static-networking + udev-configuration udev-configuration? udev-configuration-rules @@ -2656,6 +2658,20 @@ (define-deprecated (static-networking-service interface ip (provision provision) (name-servers name-servers))))) +(define %qemu-static-networking + ;; Networking configuration for QEMU's user-mode network stack (info "(QEMU) + ;; Using the user mode network stack"). + (static-networking + (addresses (list (network-address + (device "eth0") + (value "10.0.2.15/24")))) + (routes (list (network-route + (destination "default") + (gateway "10.0.2.2")))) + (requirement '()) + (provision '(networking)) + (name-servers '("10.0.2.3")))) + (define %base-services ;; Convenience variable holding the basic services. diff --git a/gnu/system/hurd.scm b/gnu/system/hurd.scm index 0e73ca0d99..ec8484d746 100644 --- a/gnu/system/hurd.scm +++ b/gnu/system/hurd.scm @@ -86,21 +86,12 @@ (define %base-services/hurd (value "127.0.0.1")))) (requirement '()) (provision '(loopback))) - (static-networking - (addresses - ;; The default QEMU guest address. To get "eth0", - ;; you need QEMU to emulate a device for which Mach - ;; has an in-kernel driver, for instance with: - ;; --device rtl8139,netdev=net0 --netdev user,id=net0 - (list (network-address - (device "eth0") - (value "10.0.2.15/24")))) - (routes - (list (network-route - (destination "default") - (gateway "10.0.2.2")))) - (provision '(networking)) - (name-servers '("10.0.2.3"))))) + + ;; QEMU user-mode networking. To get "eth0", you need + ;; QEMU to emulate a device for which Mach has an + ;; in-kernel driver, for instance with: + ;; --device rtl8139,netdev=net0 --netdev user,id=net0 + %qemu-static-networking)) (syslog-service) (service guix-service-type (guix-configuration -- 2.33.0