From nobody Sun Nov 24 21:41:09 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=1720097440; cv=none; d=zohomail.com; s=zohoarc; b=K59i1V7qaOrgvOfXrnCdXpJKKisFSVU3zr166uqxeVrgzYBmLIyg2fkuwwToE/xtban63lolHcg0vmT5ISvxK0augebHYuwvM+tcfZsOcQmppklJ8zuWLpeaUl3MhN+x3r2x6qjNuRrTcb3ttUKzu+GsPDnLSEFEl9kHiB9mKMM= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1720097440; h=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=gSClSFqgDijE7gySCiOqoSrtd8XEDPCNBGX6CqO2M6U=; b=NVTGEmUmBE/m+U5qLRYMM8rSWzWkkRbhSUYBJgla9y92M3mbKoTAPvhInShu2UTX/LctxJo2dg37OZnHE8crjH//Tw9sLfrdAZOv6kc39NySEejFm1Q5Q3EfDll03kLwcUVFheKel+hz+BiLKwmibMUdO7zOEokZ+4rS+i2trMc= 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 1720097440917500.90219548929485; Thu, 4 Jul 2024 05:50:40 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sPLtg-0004ZN-CD; Thu, 04 Jul 2024 08:49:12 -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 1sPLtN-0004BU-OK for qemu-devel@nongnu.org; Thu, 04 Jul 2024 08:48:55 -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 1sPLtH-0006N4-KX for qemu-devel@nongnu.org; Thu, 04 Jul 2024 08:48:53 -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-618-pXkspCKQNdKIl2d3SmTF7Q-1; Thu, 04 Jul 2024 08:48:42 -0400 Received: from mx-prod-int-03.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-03.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.12]) (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 7B7F619560B3; Thu, 4 Jul 2024 12:48:41 +0000 (UTC) Received: from lenovo-t14s.redhat.com (unknown [10.39.192.194]) by mx-prod-int-03.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 92E9D1956046; Thu, 4 Jul 2024 12:48:38 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1720097325; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=gSClSFqgDijE7gySCiOqoSrtd8XEDPCNBGX6CqO2M6U=; b=iwWoKO0eBqCkJFXvQbHrPqr066AgREGlaZU1LD8Fxjbe+YZAVfMBMARDgS0EBI8bE7XNs2 gKf7gQcmtV3Md4jQaIXbbvilFqiCTfXeqce1poZoLScNatcjfBzbJvBHaYFUShhQkhxSlF GtNwS9iUpPtPOsu4dBmzdh7MizlCroI= X-MC-Unique: pXkspCKQNdKIl2d3SmTF7Q-1 From: Laurent Vivier To: qemu-devel@nongnu.org Cc: =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= , Jason Wang , Laurent Vivier Subject: [PATCH v2 1/4] net: update netdev stream/dgram man page Date: Thu, 4 Jul 2024 14:48:31 +0200 Message-ID: <20240704124834.81958-2-lvivier@redhat.com> In-Reply-To: <20240704124834.81958-1-lvivier@redhat.com> References: <20240704124834.81958-1-lvivier@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.0 on 10.30.177.12 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=lvivier@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, 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: 1720097441500100002 Content-Type: text/plain; charset="utf-8" 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 Acked-by: Jason Wang Reviewed-by: Marc-Andr=C3=A9 Lureau --- qemu-options.hx | 114 ++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 114 insertions(+) diff --git a/qemu-options.hx b/qemu-options.hx index 8ca7f34ef0c8..2a099731ea0a 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][,counter][,pincounter][,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.45.2 From nobody Sun Nov 24 21:41:09 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=1720097456; cv=none; d=zohomail.com; s=zohoarc; b=UvalBJN+k0mUvyHRzKQplfhYCf8SclwFA4e1GUh43txLZiagqu9GkwFxWjWBVldfmeenIMiGN1iz7YZVrei8odJVR5LE3aazvT1pKAFONQv3p/XW3/VO5PUc4Rq6uCyBrNpa8l0jHqxavWvWXmWNKGQ6Sivirun/HiIsiQSnctI= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1720097456; h=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=b14Iq179KB9r4vFMn7lJuT4Zw90NLVWbiSbt+SfClCw=; b=Y27iOOI/DOPyXw9SpdykG+VU48EoyJJijal30DzNyOP+Vm50guxFtSbnZ1Y6NnWoja7hR5LSEqgE+RYdWjHyI2o6yF3kY/t60FSpx4dcyogcVC0iy2y3fyiJr7QvatfBviRfqwLtU7CsvVrmajcCNMVhaZI/Hbi72lsNGJx/FNs= 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 1720097456602703.1826985923958; Thu, 4 Jul 2024 05:50:56 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sPLtd-0004Vz-JF; Thu, 04 Jul 2024 08:49:10 -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 1sPLtN-0004BT-JS for qemu-devel@nongnu.org; Thu, 04 Jul 2024 08:48:55 -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 1sPLtH-0006Ng-Tp for qemu-devel@nongnu.org; Thu, 04 Jul 2024 08:48:53 -0400 Received: from mx-prod-mc-02.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-630-it3F5MypMjamiy68QoWcgQ-1; Thu, 04 Jul 2024 08:48:44 -0400 Received: from mx-prod-int-03.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-03.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.12]) (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-02.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 1D0821955F0D; Thu, 4 Jul 2024 12:48:43 +0000 (UTC) Received: from lenovo-t14s.redhat.com (unknown [10.39.192.194]) by mx-prod-int-03.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id A5AEE1956046; Thu, 4 Jul 2024 12:48:41 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1720097327; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=b14Iq179KB9r4vFMn7lJuT4Zw90NLVWbiSbt+SfClCw=; b=OQyEkmVqGUvN+DU7NOM/pc3Ga/OgXHBi8jsJuzFjpMA5VGXWWG1IX5TR+t3xW3FSIlgExr 5T0ItiWuxHkWzt0POxcSfXp2c3ZF5dP4BtGmJsbug1YgYo8X7hCzlbTtwI0XeBJoJGTedR t17DxmhPet0SPCs/j2rKIU46GWWkXXw= X-MC-Unique: it3F5MypMjamiy68QoWcgQ-1 From: Laurent Vivier To: qemu-devel@nongnu.org Cc: =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= , Jason Wang , Laurent Vivier Subject: [PATCH v2 2/4] net: update netdev stream man page with unix socket Date: Thu, 4 Jul 2024 14:48:32 +0200 Message-ID: <20240704124834.81958-3-lvivier@redhat.com> In-Reply-To: <20240704124834.81958-1-lvivier@redhat.com> References: <20240704124834.81958-1-lvivier@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.0 on 10.30.177.12 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=lvivier@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, 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, SPF_HELO_NONE=0.001, T_SPF_TEMPERROR=0.01 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: 1720097457276100005 Content-Type: text/plain; charset="utf-8" Add the description of "-netdev stream" with a unix domain socket. The code has been added but the man page has not been updated. Include an example how to use "-netdev stream" and "passt" in place of "-netdev user". ("passt" is a non privileged translation proxy between layer-2, like "-netdev stream", and layer-4 on host, like TCP, UDP, ICMP/ICMPv6 echo) Fixes: 13c6be96618c ("net: stream: add unix socket") Signed-off-by: Laurent Vivier Acked-by: Jason Wang Reviewed-by: Marc-Andr=C3=A9 Lureau --- qemu-options.hx | 40 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 40 insertions(+) diff --git a/qemu-options.hx b/qemu-options.hx index 2a099731ea0a..ef476b593cd1 100644 --- a/qemu-options.hx +++ b/qemu-options.hx @@ -3393,6 +3393,46 @@ SRST -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 =20 +``-netdev stream,id=3Dstr[,server=3Don|off],addr.type=3Dunix,addr.path=3Dp= ath[,abstract=3Don|off][,tight=3Don|off]`` + Configure a network backend to connect to another QEMU virtual machine= or a proxy using a stream oriented unix domain socket. + + ``server=3Don|off`` + if ``on`` create a server socket + + ``addr.path=3Dpath`` + filesystem path to use + + ``abstract=3Don|off`` + if ``on``, this is a Linux abstract socket address. + + ``tight=3Don|off`` + if false, pad an abstract socket address with enough null bytes to= make it fill struct sockaddr_un member sun_path. + + Example (using passt as a replacement of -netdev user): + + .. parsed-literal:: + + # start passt server as a non privileged user + passt + UNIX domain socket bound at /tmp/passt_1.socket + # start QEMU to connect to passt + |qemu_system| linux.img \\ + -device virtio-net,netdev=3Dnet0 \\ + -netdev stream,id=3Dnet0,server=3Doff,addr.type=3Dun= ix,addr.path=3D/tmp/passt_1.socket + + Example (two guests connected using a stream oriented unix domain sock= et): + + .. 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=3Dunix= ,addr.path=3D/tmp/qemu0 + # 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=3Dun= ix,addr.path=3D/tmp/qemu0 + ``-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. =20 --=20 2.45.2 From nobody Sun Nov 24 21:41:09 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=1720097449; cv=none; d=zohomail.com; s=zohoarc; b=AH91IEh8Lw3rBdVv/BXPs6tNKHAmytdsrmKRpMj8O4DYWjokMGsYx+ccoVMZePhzrZmf7SGblsCEkwZgJdMopHntx+lGuPKB9oXZvmWLigFRHf7XmPXCWF4KX14ysC6TIqO71TcANCEllFM8qJc+soC2UciyWgWvT/QV1aTduQM= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1720097449; h=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=+U+uAb8unO3/V8/H5R+PzRuVxuF7mhUJxgXTQI3xkqk=; b=FUpV/tDkjodd6h+HA2hfSn36bH+JxDbgOXtpaHq3yibQ5D7JkCDTEu/3d8yxXXlqGGlzrvO9I0rdCb7fuafO8bmKVZ5mJ/P5xQQc4IcmjiiGP9M8v8EZGh0AJo9MhkrI2ddG8vHR3ymdhqU74JQ4IusLW8Dya9k3SA0sEQRv42A= 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 172009744947482.03892149894466; Thu, 4 Jul 2024 05:50:49 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sPLtd-0004Vk-9N; Thu, 04 Jul 2024 08:49:09 -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 1sPLtR-0004CW-6Z for qemu-devel@nongnu.org; Thu, 04 Jul 2024 08:48:57 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sPLtJ-0006Nj-Ua for qemu-devel@nongnu.org; Thu, 04 Jul 2024 08:48:56 -0400 Received: from mx-prod-mc-02.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-141-XqCSA94yPvii40c2QvMgXA-1; Thu, 04 Jul 2024 08:48:45 -0400 Received: from mx-prod-int-03.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-03.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.12]) (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-02.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 0ED88195609D; Thu, 4 Jul 2024 12:48:45 +0000 (UTC) Received: from lenovo-t14s.redhat.com (unknown [10.39.192.194]) by mx-prod-int-03.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 9A6F91956046; Thu, 4 Jul 2024 12:48:43 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1720097327; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=+U+uAb8unO3/V8/H5R+PzRuVxuF7mhUJxgXTQI3xkqk=; b=A+MCdzl4ZJ60Ut+O4yHJ2AVoupxn+Zf4xeovEGVVyRNLByJKnZogi6XQZPQNOdj0Kt4VI3 9fkMo6fp3ogqK0yY4HQBQcYLPwjcRVHIJz+3p0IT90v7aXGuyPJXBVF8x9SVZfIJVBsUIh 3vWn3PC5HFWOzUTCdBoTWUrMqF7Xvks= X-MC-Unique: XqCSA94yPvii40c2QvMgXA-1 From: Laurent Vivier To: qemu-devel@nongnu.org Cc: =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= , Jason Wang , Laurent Vivier Subject: [PATCH v2 3/4] net: update netdev dgram man page with unix socket Date: Thu, 4 Jul 2024 14:48:33 +0200 Message-ID: <20240704124834.81958-4-lvivier@redhat.com> In-Reply-To: <20240704124834.81958-1-lvivier@redhat.com> References: <20240704124834.81958-1-lvivier@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.0 on 10.30.177.12 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.129.124; envelope-from=lvivier@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, 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, 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: 1720097451258100003 Content-Type: text/plain; charset="utf-8" Add the description of "-netdev dgram" with a unix domain socket. The code has been added but the man page has not been updated. Fixes: 784e7a253104 ("net: dgram: add unix socket") Signed-off-by: Laurent Vivier Acked-by: Jason Wang Reviewed-by: Marc-Andr=C3=A9 Lureau --- qemu-options.hx | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/qemu-options.hx b/qemu-options.hx index ef476b593cd1..1bbf629b9959 100644 --- a/qemu-options.hx +++ b/qemu-options.hx @@ -3500,6 +3500,29 @@ SRST -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 =20 +``-netdev dgram,id=3Dstr,local.type=3Dunix,local.path=3Dpath[,remote.type= =3Dunix,remote.path=3Dpath]`` + Configure a network backend to connect to another QEMU virtual + machine or a proxy using a datagram oriented unix socket. + + ``local.path=3Dpath`` + filesystem path to use to bind the socket + + ``remote.path=3Dpath`` + filesystem path to use as a destination (see sendto(2)) + + Example (two guests connected using an UDP/UNIX 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=3Dunix,local.path= =3D/tmp/qemu0,remote.type=3Dunix,remote.path=3D/tmp/qemu1 + # second VM + |qemu_system| linux.img \\ + -device virtio-net,netdev=3Dnet0,mac=3D52:54:00:12:3= 4:57 \\ + -netdev dgram,id=3Dnet0,local.type=3Dunix,local.path= =3D/tmp/qemu1,remote.type=3Dunix,remote.path=3D/tmp/qemu0 + ``-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. --=20 2.45.2 From nobody Sun Nov 24 21:41:09 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=1720097440; cv=none; d=zohomail.com; s=zohoarc; b=WhFzMJgofMf/9yzOCWSvSFXeOkEFlSrWP8fLQY2RKHgLjFxyVyOA5zio7yb2FchhKvkOxyPsId1DLM16CCgK8/zHHyLgXAiHKT+VCm07qoPWRQ3Zxd6SR5avzbYwfvIM0Sq6AepAZfVM01nIoHLAmcCPznS6g/Pulj2E11g5ufc= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1720097440; h=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=QiPH4cU9/QV7duZggbkflxxRqgm65xLkTAkWIk/OAhg=; b=nJA4ptIOyLnVAfHXdd31x8rFKoF40dAJGuKIDZrON6lYvpMkM50yXaSidYmjTTNdj5LTMzcCFDl0lzhTwEZCcjlUuHVhP0lqs5262F+5XXxDrLgkkefh+ufI6f6WIZ5sqyBi+W9sCJAvD4AdknNkbO31y05/MXMyz7xjK+F0P8E= 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 1720097440822526.0893701108678; Thu, 4 Jul 2024 05:50:40 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sPLtc-0004VV-Hk; Thu, 04 Jul 2024 08:49:08 -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 1sPLtQ-0004CK-EW for qemu-devel@nongnu.org; Thu, 04 Jul 2024 08:48:57 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sPLtM-0006OK-DL for qemu-devel@nongnu.org; Thu, 04 Jul 2024 08:48:54 -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-185-VfVt7negMs6Wvq6hC_NhKw-1; Thu, 04 Jul 2024 08:48:47 -0400 Received: from mx-prod-int-03.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-03.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.12]) (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 D4A2819560B9; Thu, 4 Jul 2024 12:48:46 +0000 (UTC) Received: from lenovo-t14s.redhat.com (unknown [10.39.192.194]) by mx-prod-int-03.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 6E2B11955F65; Thu, 4 Jul 2024 12:48:45 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1720097330; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=QiPH4cU9/QV7duZggbkflxxRqgm65xLkTAkWIk/OAhg=; b=S5L+6xlc6bKWeyW4L3VfzXjL4dZNNm9O09brrxS01I74WzPNZwPzcUtnyW2aC40HhsrNrl AnTyoCy2wpuNEarzrj+l/6puT1l3pl3mZqn5ANzvvqS6897kQSo+Xee189Xvu8REBb9QVD jot81xl9U3hYQ22WKNd9jhzImNSJHIA= X-MC-Unique: VfVt7negMs6Wvq6hC_NhKw-1 From: Laurent Vivier To: qemu-devel@nongnu.org Cc: =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= , Jason Wang , Laurent Vivier Subject: [PATCH v2 4/4] net: update netdev stream man page with the reconnect parameter Date: Thu, 4 Jul 2024 14:48:34 +0200 Message-ID: <20240704124834.81958-5-lvivier@redhat.com> In-Reply-To: <20240704124834.81958-1-lvivier@redhat.com> References: <20240704124834.81958-1-lvivier@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.0 on 10.30.177.12 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.129.124; envelope-from=lvivier@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, 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, 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: 1720097441478100001 Content-Type: text/plain; charset="utf-8" "-netdev stream" supports a reconnect parameter that attempts to reconnect automatically the socket if it is disconnected. The code has been added but the man page has not been updated. Fixes: 148fbf0d58a6 ("net: stream: add a new option to automatically reconn= ect" Signed-off-by: Laurent Vivier Acked-by: Jason Wang Reviewed-by: Marc-Andr=C3=A9 Lureau --- qemu-options.hx | 22 +++++++++++++++++----- 1 file changed, 17 insertions(+), 5 deletions(-) diff --git a/qemu-options.hx b/qemu-options.hx index 1bbf629b9959..c78f69851bf3 100644 --- a/qemu-options.hx +++ b/qemu-options.hx @@ -3353,7 +3353,7 @@ 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]`` +``-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][,reconnect=3Ds= econds]`` Configure a network backend to connect to another QEMU virtual machine= or a proxy using a TCP/IP socket. =20 ``server=3Don|off`` @@ -3380,6 +3380,10 @@ SRST ``ipv6=3Don|off`` whether to accept IPv6 addresses, default to try both IPv4 and IPv6 =20 + ``reconnect=3Dseconds`` + for a client socket, if a socket is disconnected, then attempt a r= econnect after the given number of seconds. + Setting this to zero disables this function. (default: 0) + Example (two guests connected using a TCP/IP socket): =20 .. parsed-literal:: @@ -3391,9 +3395,9 @@ SRST # 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=3Dnet0,server=3Doff,addr.type=3Din= et,addr.host=3Dlocalhost,addr.port=3D1234,reconnect=3D5 =20 -``-netdev stream,id=3Dstr[,server=3Don|off],addr.type=3Dunix,addr.path=3Dp= ath[,abstract=3Don|off][,tight=3Don|off]`` +``-netdev stream,id=3Dstr[,server=3Don|off],addr.type=3Dunix,addr.path=3Dp= ath[,abstract=3Don|off][,tight=3Don|off][,reconnect=3Dseconds]`` Configure a network backend to connect to another QEMU virtual machine= or a proxy using a stream oriented unix domain socket. =20 ``server=3Don|off`` @@ -3408,6 +3412,10 @@ SRST ``tight=3Don|off`` if false, pad an abstract socket address with enough null bytes to= make it fill struct sockaddr_un member sun_path. =20 + ``reconnect=3Dseconds`` + for a client socket, if a socket is disconnected, then attempt a r= econnect after the given number of seconds. + Setting this to zero disables this function. (default: 0) + Example (using passt as a replacement of -netdev user): =20 .. parsed-literal:: @@ -3431,9 +3439,9 @@ SRST # 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=3Dun= ix,addr.path=3D/tmp/qemu0 + -netdev stream,id=3Dnet0,server=3Doff,addr.type=3Dun= ix,addr.path=3D/tmp/qemu0,reconnect=3D5 =20 -``-netdev stream,id=3Dstr[,server=3Don|off],addr.type=3Dfd,addr.str=3Dfile= -descriptor`` +``-netdev stream,id=3Dstr[,server=3Don|off],addr.type=3Dfd,addr.str=3Dfile= -descriptor[,reconnect=3Dseconds]`` Configure a network backend to connect to another QEMU virtual machine= or a proxy using a stream oriented socket file descriptor. =20 ``server=3Don|off`` @@ -3442,6 +3450,10 @@ SRST ``addr.str=3Dfile-descriptor`` file descriptor number to use as a socket =20 + ``reconnect=3Dseconds`` + for a client socket, if a socket is disconnected, then attempt a r= econnect after the given number of seconds. + Setting this to zero disables this function. (default: 0) + ``-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. =20 --=20 2.45.2