From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp1 ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms0.migadu.com with LMTPS id 8AjSLxDgkmEkJAAAgWs5BA (envelope-from ) for ; Mon, 15 Nov 2021 23:32:48 +0100 Received: from aspmx1.migadu.com ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp1 with LMTPS id kGZgKxDgkmG4UwAAbx9fmQ (envelope-from ) for ; Mon, 15 Nov 2021 22:32:48 +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 41AFB167F9 for ; Mon, 15 Nov 2021 23:32:48 +0100 (CET) Received: from localhost ([::1]:58090 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mmkWt-0001n5-Ei for larch@yhetil.org; Mon, 15 Nov 2021 17:32:47 -0500 Received: from eggs.gnu.org ([209.51.188.92]:53684) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mmkWC-00007r-6Y for guix-patches@gnu.org; Mon, 15 Nov 2021 17:32:04 -0500 Received: from debbugs.gnu.org ([209.51.188.43]:44912) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mmkWB-0002B8-TZ for guix-patches@gnu.org; Mon, 15 Nov 2021 17:32:03 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1mmkWB-0003lf-PT for guix-patches@gnu.org; Mon, 15 Nov 2021 17:32:03 -0500 X-Loop: help-debbugs@gnu.org Subject: [bug#51440] [PATCH v2 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: Mon, 15 Nov 2021 22:32:03 +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.163701547614330 (code B ref 51440); Mon, 15 Nov 2021 22:32:03 +0000 Received: (at 51440) by debbugs.gnu.org; 15 Nov 2021 22:31:16 +0000 Received: from localhost ([127.0.0.1]:56442 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mmkVQ-0003iw-7V for submit@debbugs.gnu.org; Mon, 15 Nov 2021 17:31:16 -0500 Received: from eggs.gnu.org ([209.51.188.92]:52542) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mmkVF-0003h3-9M for 51440@debbugs.gnu.org; Mon, 15 Nov 2021 17:31:11 -0500 Received: from [2001:470:142:3::e] (port=52032 helo=fencepost.gnu.org) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mmkVA-00020Y-2x; Mon, 15 Nov 2021 17:31:00 -0500 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=RGZGk2T8KUz5/i5BnLz684J2l78w5TL3HmxXzTYaXOw=; b=fs/o1NNO78BsCbh6Q0br 66sSail2XXT6TmD4wYSGrYAK4nBfwLaI91iDRarqprCifggyt4tCDO1G/z3BpGcV9H1XNVNnIzTKz exsYBuIJoOx/ZoY8q6rJLOMyYidX+a4giEtnQA8r0Lv8juPRnBKKzcf37W5zhswWh5Y2NO//H3xUC JWcYKDgj6GgeDh5tODjaTiahK2fdKaO0cf5faJfG4K070oIBCJ3BVfe0Mndjgh/9sJxP4HxVB1yKP ovO0W7qtE2wCpTB1t3t+DPEGeNcj/4b5BeEvwjr2TqUI4bJsHnX4IDV8fa5ImAbpc/ZMo8Af6cZEd TQLsHWjj7cjt9g==; Received: from [2a01:e0a:1d:7270:af76:b9b:ca24:c465] (port=44414 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 1mmkV9-0001jO-N3; Mon, 15 Nov 2021 17:31:00 -0500 From: Ludovic =?UTF-8?Q?Court=C3=A8s?= Date: Mon, 15 Nov 2021 23:30:42 +0100 Message-Id: <20211115223044.10943-9-ludo@gnu.org> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20211115223044.10943-1-ludo@gnu.org> References: <20211027135918.18833-1-ludo@gnu.org> <20211115223044.10943-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 X-Migadu-Country: US ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1637015568; 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=8c/p1OlnN4RwTQ4J7TvbdG21SSl3fEDYW/8T2p3ElpI=; b=Zmc5z8cKjZGvMcb8nNFvk5QHMwei14MCwCERb1UQnFpS0XNRcid+4c7Wt7VgNunu9FubSX Sx06EQz+P9zY4S/qAzkXqfEeVUIbL19C4jQcveVmv+myIcpU2//gG5Up22342yaxH7EDd9 LRdqsdkOMmzdBoKglh4BypW/CVVGkpJAOYABs1u9LbVvULiRIdRiPabCvp8l1r8WUX0r7W qdbkwaD0r1j5lbFEEIWMlPvEry8ioXMs/jdFIja5yfR3HjsE2sopjIZqvCNNu0VaA49J9F gRUC1JzYjdlT/u1xRvdxnk9EdBAySwLE2FMd0pr6ROih1kxDOfD1p7zEmDDJlQ== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1637015568; a=rsa-sha256; cv=none; b=RamR520Yy5up0FcXp9oylO08xSsiGlGdkmkfBv9CN4Jm46XFfL/ZqCBooSJOrJY1teinWK aDSs8151OmwpRTx+EvK0c9cC8sXuRiSPeqGnuYTe746yTMH7QGpI7Vf7OA55mH4uuBN2/K ORGo0Z1F1msmOP3+xvFwqATYgHKj5Ig7isXmhZ9/Rtc/as5ULlwLG9Q+t57sTjfinj3RtN ss7gX5ePvDj8xdwhlLfKOB3k4zpSkj7hKnOVQkwfqkasTDJ/HuAmW6+R7R0hQoc6RNg6sr xhBe9AM9gAZ1iu3p8Y5LE/sOFSNQzEk238W4l3xyfWBuvJlQrn6s5bxi+akSiQ== 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="fs/o1NNO"; spf=pass (aspmx1.migadu.com: domain of "guix-patches-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="guix-patches-bounces+larch=yhetil.org@gnu.org" X-Migadu-Spam-Score: -0.54 Authentication-Results: aspmx1.migadu.com; dkim=fail ("body hash did not verify") header.d=gnu.org header.s=fencepost-gnu-org header.b="fs/o1NNO"; spf=pass (aspmx1.migadu.com: domain of "guix-patches-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="guix-patches-bounces+larch=yhetil.org@gnu.org" X-Migadu-Queue-Id: 41AFB167F9 X-Spam-Score: -0.54 X-Migadu-Scanner: scn0.migadu.com X-TUID: WmDDcBDyNi6L * 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 439ef28e96..85e76991d9 100644 --- a/doc/guix.texi +++ b/doc/guix.texi @@ -16940,6 +16940,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 112c6ab065..e78add4e20 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 @@ -2669,6 +2671,20 @@ (define-deprecated (static-networking-service interface ip (provision (or provision '(networking))) (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