From nobody Sun Nov 24 16:47:06 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1722568906; cv=none; d=zohomail.com; s=zohoarc; b=YmWBI1vLChBbisjEi0OmAmROrEYHD2FJsFsOXzzSTFUjUn2wa9nehFeRJBV70jYhwd0DQMjdyOFjljnGoir02yLhwZHLh0CTNZ2a1oS1OyGxBXu4YqxCIPyOsIZJfdhZoOOMPlJfm85jrJYfJGsxkAOwSd3XhfFvuGFucxMMIdA= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1722568906; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=yH7Hhnxy+JZeYhNTYJSvoZ9X0We0m2TGS1abbdMhA+w=; b=FJu3u0hlbAfJYRUwti1YkLQZ5635yyYaH8NoPZ6mjtpsZSqSVrjotGJlPDrycYLCbLL2/U/BET7qoK+I6+5JaOy8YpyqhScVDeS7uuZxwgH7cU+lQF7wBuY4m+WZvkbVGdaLhCblawb9ZBXBLueXw9TkWz6W6H+Pf+dYbel9WHo= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1722568906896332.1314259261743; Thu, 1 Aug 2024 20:21:46 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sZipr-00047G-Hn; Thu, 01 Aug 2024 23:20:07 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sZipo-0003rq-KO for qemu-devel@nongnu.org; Thu, 01 Aug 2024 23:20:04 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sZipk-0008Rg-FE for qemu-devel@nongnu.org; Thu, 01 Aug 2024 23:20:03 -0400 Received: from mx-prod-mc-04.mail-002.prod.us-west-2.aws.redhat.com (ec2-54-186-198-63.us-west-2.compute.amazonaws.com [54.186.198.63]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-124-BUoW7K4zMr6vrT31lF51mg-1; Thu, 01 Aug 2024 23:19:58 -0400 Received: from mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.4]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-04.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id AE39A1955D4F for ; Fri, 2 Aug 2024 03:19:56 +0000 (UTC) Received: from localhost.localdomain (unknown [10.72.112.229]) by mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 36B6B300019D; Fri, 2 Aug 2024 03:19:52 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1722568799; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=yH7Hhnxy+JZeYhNTYJSvoZ9X0We0m2TGS1abbdMhA+w=; b=BZOJvwrfMIROmagTuBGH0rGHWGOBfdH4ByMb8bYWWfFoqmbMCnQN+YE4cWzxHf+Hy9oJqL XFEbzednmpSPnfCGtAs7cTjY3ya1RSVtce15prhoYSb+LopmZqHP4Uq08j0UoDpPDssJc1 tT5ZMnLVwnAOSWgBxdhnZaRkrMUo6OQ= X-MC-Unique: BUoW7K4zMr6vrT31lF51mg-1 From: Jason Wang To: qemu-devel@nongnu.org Cc: Laurent Vivier , =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= , Jason Wang Subject: [PULL 4/8] net: update netdev stream/dgram man page Date: Fri, 2 Aug 2024 11:19:25 +0800 Message-ID: <20240802031929.44060-5-jasowang@redhat.com> In-Reply-To: <20240802031929.44060-1-jasowang@redhat.com> References: <20240802031929.44060-1-jasowang@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.4.1 on 10.30.177.4 Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=170.10.133.124; envelope-from=jasowang@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -21 X-Spam_score: -2.2 X-Spam_bar: -- X-Spam_report: (-2.2 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.131, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H4=0.001, RCVD_IN_MSPIKE_WL=0.001, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, RCVD_IN_VALIDITY_SAFE_BLOCKED=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1722568907122116600 From: Laurent Vivier Add the description of "-netdev stream" and "-netdev dgram" in the QEMU manpage. Add some examples on how to use them. Fixes: 5166fe0ae46d ("qapi: net: add stream and dgram netdevs") Signed-off-by: Laurent Vivier Reviewed-by: Marc-Andr=C3=A9 Lureau Signed-off-by: Jason Wang --- qemu-options.hx | 114 ++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 114 insertions(+) diff --git a/qemu-options.hx b/qemu-options.hx index 369ae81d7c..52143cfb8f 100644 --- a/qemu-options.hx +++ b/qemu-options.hx @@ -3353,6 +3353,120 @@ SRST -device e1000,netdev=3Dn1,mac=3D52:54:00:12:34:56= \\ -netdev socket,id=3Dn1,mcast=3D239.192.168.1:1102= ,localaddr=3D1.2.3.4 =20 +``-netdev stream,id=3Dstr[,server=3Don|off],addr.type=3Dinet,addr.host=3Dh= ost,addr.port=3Dport[,to=3Dmaxport][,numeric=3Don|off][,keep-alive=3Don|off= ][,mptcp=3Don|off][,addr.ipv4=3Don|off][,addr.ipv6=3Don|off]`` + Configure a network backend to connect to another QEMU virtual machine= or a proxy using a TCP/IP socket. + + ``server=3Don|off`` + if ``on`` create a server socket + + ``addr.host=3Dhost,addr.port=3Dport`` + socket address to listen on (server=3Don) or connect to (server=3D= off) + + ``to=3Dmaxport`` + if present, this is range of possible addresses, with port between= ``port`` and ``maxport``. + + ``numeric=3Don|off`` + if ``on`` ``host`` and ``port`` are guaranteed to be numeric, othe= rwise a name resolution should be attempted (default: ``off``) + + ``keep-alive=3Don|off`` + enable keep-alive when connecting to this socket. Not supported f= or passive sockets. + + ``mptcp=3Don|off`` + enable multipath TCP + + ``ipv4=3Don|off`` + whether to accept IPv4 addresses, default to try both IPv4 and IPv6 + + ``ipv6=3Don|off`` + whether to accept IPv6 addresses, default to try both IPv4 and IPv6 + + Example (two guests connected using a TCP/IP socket): + + .. parsed-literal:: + + # first VM + |qemu_system| linux.img \\ + -device virtio-net,netdev=3Dnet0,mac=3D52:54:00:12:3= 4:56 \\ + -netdev stream,id=3Dnet0,server=3Don,addr.type=3Dine= t,addr.host=3Dlocalhost,addr.port=3D1234 + # second VM + |qemu_system| linux.img \\ + -device virtio-net,netdev=3Dnet0,mac=3D52:54:00:12:3= 4:57 \\ + -netdev stream,id=3Dnet0,server=3Doff,addr.type=3Din= et,addr.host=3Dlocalhost,addr.port=3D1234 + +``-netdev stream,id=3Dstr[,server=3Don|off],addr.type=3Dfd,addr.str=3Dfile= -descriptor`` + Configure a network backend to connect to another QEMU virtual machine= or a proxy using a stream oriented socket file descriptor. + + ``server=3Don|off`` + if ``on`` create a server socket + + ``addr.str=3Dfile-descriptor`` + file descriptor number to use as a socket + +``-netdev dgram,id=3Dstr,remote.type=3Dinet,remote.host=3Dmaddr,remote.por= t=3Dport[,local.type=3Dinet,local.host=3Daddr]`` + Configure a network backend to connect to a multicast address. + + ``remote.host=3Dmaddr,remote.port=3Dport`` + multicast address + + ``local.host=3Daddr`` + specify the host address to send packets from + + Example: + + .. parsed-literal:: + + # launch one QEMU instance + |qemu_system| linux.img \\ + -device virtio-net,netdev=3Dnet0,mac=3D52:54:00:12:3= 4:56 \\ + -netdev dgram,id=3Dnet0,remote.type=3Dinet,remote.ho= st=3D224.0.0.1,remote.port=3D1234 + # launch another QEMU instance on same "bus" + |qemu_system| linux.img \\ + -device virtio-net,netdev=3Dnet0,mac=3D52:54:00:12:3= 4:57 \\ + -netdev dgram,id=3Dnet0,remote.type=3Dinet,remote.ho= st=3D224.0.0.1,remote.port=3D1234 + # launch yet another QEMU instance on same "bus" + |qemu_system| linux.img \\ + -device virtio-net,netdev=3Dnet0,mac=3D52:54:00:12:3= 4:58 \\ + -netdev dgram,id=3Dnet0,remote.type=3Dinet,remote.ho= st=3D224.0.0.1,remote.port=3D1234 + +``-netdev dgram,id=3Dstr,remote.type=3Dinet,remote.host=3Dmaddr,remote.por= t=3Dport[,local.type=3Dfd,local.str=3Dfile-descriptor]`` + Configure a network backend to connect to a multicast address using a = UDP socket file descriptor. + + ``remote.host=3Dmaddr,remote.port=3Dport`` + multicast address + + ``local.str=3Dfile-descriptor`` + File descriptor to use to send packets + +``-netdev dgram,id=3Dstr,local.type=3Dinet,local.host=3Daddr,local.port=3D= port[,remote.type=3Dinet,remote.host=3Daddr,remote.port=3Dport]`` + Configure a network backend to connect to another QEMU virtual + machine or a proxy using a datagram oriented unix domain socket. + + ``local.host=3Daddr,local.port=3Dport`` + IP address to use to send the packets from + + ``remote.host=3Daddr,remote.port=3Dport`` + Destination IP address + + Example (two guests connected using an UDP/IP socket): + + .. parsed-literal:: + + # first VM + |qemu_system| linux.img \\ + -device virtio-net,netdev=3Dnet0,mac=3D52:54:00:12:3= 4:56 \\ + -netdev dgram,id=3Dnet0,local.type=3Dinet,local.host= =3Dlocalhost,local.port=3D1234,remote.type=3Dinet,remote.host=3Dlocalhost,r= emote.port=3D1235 + # second VM + |qemu_system| linux.img \\ + -device virtio-net,netdev=3Dnet0,mac=3D52:54:00:12:3= 4:56 \\ + -netdev dgram,id=3Dnet0,local.type=3Dinet,local.host= =3Dlocalhost,local.port=3D1235,remote.type=3Dinet,remote.host=3Dlocalhost,r= emote.port=3D1234 + +``-netdev dgram,id=3Dstr,local.type=3Dfd,local.str=3Dfile-descriptor`` + Configure a network backend to connect to another QEMU virtual + machine or a proxy using a datagram oriented socket file descriptor. + + ``local.str=3Dfile-descriptor`` + File descriptor to use to send packets + ``-netdev l2tpv3,id=3Did,src=3Dsrcaddr,dst=3Ddstaddr[,srcport=3Dsrcport][,= dstport=3Ddstport],txsession=3Dtxsession[,rxsession=3Drxsession][,ipv6=3Don= |off][,udp=3Don|off][,cookie64=3Don|off][,counter=3Don|off][,pincounter=3Do= n|off][,txcookie=3Dtxcookie][,rxcookie=3Drxcookie][,offset=3Doffset]`` Configure a L2TPv3 pseudowire host network backend. L2TPv3 (RFC3931) is a popular protocol to transport Ethernet (and other Layer 2) data --=20 2.42.0