From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from gandalf.ozlabs.org (gandalf.ozlabs.org [150.107.74.76]) by passt.top (Postfix) with ESMTPS id 204355A0262 for ; Wed, 8 Mar 2023 23:57:18 +0100 (CET) Received: by gandalf.ozlabs.org (Postfix, from userid 1007) id 4PX74C1F2Vz4x5R; Thu, 9 Mar 2023 09:57:15 +1100 (AEDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gibson.dropbear.id.au; s=201602; t=1678316235; bh=jxIsSgDjzN1IzBqRU8JmHGKwkKuyRmvqMNvQgn3/VyA=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=ap1NrQ6NvSRMfJvSQyAHIAwLsWiQa16VHFlPkExC0W/0Vp6CTlDAcVakxzv360/d7 s44BBYMqV3sxLMuu5AalWdkWiWlzdMVaJJNulJ3OMyd5fy+a97zMx3ThDMOb8G6VIu jYCIw728PwUPZMw6XCH/M0jHdC8B1q2VWW4ReU8w= Date: Thu, 9 Mar 2023 09:54:34 +1100 From: David Gibson To: Stefano Brivio Subject: Re: [PATCH] contrib: Drop libvirt out-of-tree patch, integration mostly works in 9.1.0 Message-ID: References: <20230308225011.2589937-1-sbrivio@redhat.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="lXlPp64MvyKmkRLO" Content-Disposition: inline In-Reply-To: <20230308225011.2589937-1-sbrivio@redhat.com> Message-ID-Hash: QODROEHQIXOOBKSYTLIGC7C3S73OB3MM X-Message-ID-Hash: QODROEHQIXOOBKSYTLIGC7C3S73OB3MM X-MailFrom: dgibson@gandalf.ozlabs.org X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header CC: passt-dev@passt.top X-Mailman-Version: 3.3.8 Precedence: list List-Id: Development discussion and patches for passt Archived-At: Archived-At: List-Archive: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: --lXlPp64MvyKmkRLO Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Wed, Mar 08, 2023 at 11:50:11PM +0100, Stefano Brivio wrote: > ...and in any case, this patch doesn't offer any advantage over the > current upstream integration. >=20 > Signed-off-by: Stefano Brivio Reviewed-by: David Gibson > --- > ...upport-for-UNIX-domain-socket-as-qem.patch | 427 ------------------ > 1 file changed, 427 deletions(-) > delete mode 100644 contrib/libvirt/0001-conf-Introduce-support-for-UNIX-= domain-socket-as-qem.patch >=20 > diff --git a/contrib/libvirt/0001-conf-Introduce-support-for-UNIX-domain-= socket-as-qem.patch b/contrib/libvirt/0001-conf-Introduce-support-for-UNIX-= domain-socket-as-qem.patch > deleted file mode 100644 > index 386cc4a..0000000 > --- a/contrib/libvirt/0001-conf-Introduce-support-for-UNIX-domain-socket-= as-qem.patch > +++ /dev/null > @@ -1,427 +0,0 @@ > -From 7afbbab2ccada16c87e1095e85184bb21c028012 Mon Sep 17 00:00:00 2001 > -Message-Id: <7afbbab2ccada16c87e1095e85184bb21c028012.1619091487.git.sbr= ivio@redhat.com> > -From: Stefano Brivio > -Date: Wed, 21 Apr 2021 19:29:31 +0200 > -Subject: [PATCH] conf: Introduce support for UNIX domain socket as qemu = netdev > - back-end > - > -Since qemu [TODO], named UNIX domain sockets can be used instead of > -TCP to establish a virtual network between VMs. > - > -The obvious difference compared with TCP is that we need pass a path > -instead of address and port. > - > -Signed-off-by: Stefano Brivio > ---- > -SPDX-FileCopyrightText: 2020-2021 Red Hat GmbH > -SPDX-License-Identifier: AGPL-3.0-or-later > - > - docs/formatdomain.rst | 41 +++++++++++++++++++------ > - docs/schemas/domaincommon.rng | 50 +++++++++++++++++++++++------- > - src/conf/domain_conf.c | 58 +++++++++++++++++++++++++++-------- > - src/conf/domain_conf.h | 13 +++++--- > - src/qemu/qemu_command.c | 46 ++++++++++++++++++--------- > - src/qemu/qemu_hotplug.c | 8 +++-- > - 6 files changed, 160 insertions(+), 56 deletions(-) > - > -diff --git a/docs/formatdomain.rst b/docs/formatdomain.rst > -index 1b9b2216111c..87c3c956fa23 100644 > ---- a/docs/formatdomain.rst > -+++ b/docs/formatdomain.rst > -@@ -5010,18 +5010,20 @@ must be from the multicast address block. > - > - ... > -=20 > --:anchor:`` > -+:anchor:`` > -=20 > --TCP tunnel > --^^^^^^^^^^ > -+TCP or UNIX domain socket tunnel > -+^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ > -+ > -+A stream-oriented client/server architecture provides a virtual network= =2E One VM > -+provides the server end of the network, all other VMS are configured as= clients. > -+All network traffic is routed between the VMs via the server. This mode= is also > -+available to unprivileged users. There is no default DNS or DHCP suppor= t and no > -+outgoing network access. To provide outgoing network access, one of the= VMs > -+should have a 2nd NIC which is connected to one of the first 4 network = types and > -+do the appropriate routing. > -=20 > --A TCP client/server architecture provides a virtual network. One VM pro= vides the > --server end of the network, all other VMS are configured as clients. All= network > --traffic is routed between the VMs via the server. This mode is also ava= ilable to > --unprivileged users. There is no default DNS or DHCP support and no outg= oing > --network access. To provide outgoing network access, one of the VMs shou= ld have a > --2nd NIC which is connected to one of the first 4 network types and do t= he > --appropriate routing. > -+TCP endpoints can be specified as follows: > -=20 > - :: > -=20 > -@@ -5039,6 +5041,25 @@ appropriate routing. > - > - ... > -=20 > -+Named UNIX domain sockets can be specified as follows: > -+:since:`Since 7.3.0, qemu` > -+ > -+:: > -+ > -+ ... > -+ > -+ > -+ > -+ > -+ > -+ ... > -+ > -+ > -+ > -+ > -+ > -+ ... > -+ > - :anchor:`` > -=20 > - UDP unicast tunnel > -diff --git a/docs/schemas/domaincommon.rng b/docs/schemas/domaincommon.r= ng > -index a2e5c50c1d77..7c0a90ba199b 100644 > ---- a/docs/schemas/domaincommon.rng > -+++ b/docs/schemas/domaincommon.rng > -@@ -3161,10 +3161,7 @@ > - > - > - > -- > -- mcast > -- client > -- > -+ mcast > - > - > - > -@@ -3179,6 +3176,30 @@ > - > - > - > -+ > -+ > -+ client > -+ > -+ > -+ > -+ > -+ > -+ > -+ > -+ > -+ > -+ > -+ > -+ > -+ > -+ > -+ > -+ > -+ > -+ > -+ > -+ > -+ > - > - > - udp > -@@ -3210,14 +3231,21 @@ > - > - > - > -- > -- > -- > -+ > -+ > -+ > -+ > -+ > -+ > -+ > -+ > -+ > -+ > -+ > -+ > -+ > - > -- > -- > -- > -- > -+ > - > - > - > -diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c > -index f8a462fb3b99..8c6a5d4f974e 100644 > ---- a/src/conf/domain_conf.c > -+++ b/src/conf/domain_conf.c > -@@ -2562,8 +2562,9 @@ virDomainNetDefFree(virDomainNetDef *def) > - case VIR_DOMAIN_NET_TYPE_CLIENT: > - case VIR_DOMAIN_NET_TYPE_MCAST: > - case VIR_DOMAIN_NET_TYPE_UDP: > -- g_free(def->data.socket.address); > -- g_free(def->data.socket.localaddr); > -+ g_free(def->data.socket.net.address); > -+ g_free(def->data.socket.net.localaddr); > -+ g_free(def->data.socket.path); > - break; > -=20 > - case VIR_DOMAIN_NET_TYPE_NETWORK: > -@@ -10555,6 +10556,7 @@ virDomainNetDefParseXML(virDomainXMLOption *xmlo= pt, > - g_autofree char *downscript =3D NULL; > - g_autofree char *address =3D NULL; > - g_autofree char *port =3D NULL; > -+ g_autofree char *path =3D NULL; > - g_autofree char *localaddr =3D NULL; > - g_autofree char *localport =3D NULL; > - g_autofree char *model =3D NULL; > -@@ -10699,7 +10701,7 @@ virDomainNetDefParseXML(virDomainXMLOption *xmlo= pt, > - " "), type); > - goto error; > - } > -- } else if (!address && > -+ } else if (!address && !path && > - (def->type =3D=3D VIR_DOMAIN_NET_TYPE_SERVER || > - def->type =3D=3D VIR_DOMAIN_NET_TYPE_CLIENT || > - def->type =3D=3D VIR_DOMAIN_NET_TYPE_MCAST || > -@@ -10707,6 +10709,7 @@ virDomainNetDefParseXML(virDomainXMLOption *xmlo= pt, > - virXMLNodeNameEqual(cur, "source")) { > - address =3D virXMLPropString(cur, "address"); > - port =3D virXMLPropString(cur, "port"); > -+ path =3D virXMLPropString(cur, "path"); > - if (!localaddr && def->type =3D=3D VIR_DOMAIN_NET_TYPE_= UDP) { > - xmlNodePtr tmpnode =3D ctxt->node; > - ctxt->node =3D cur; > -@@ -10950,6 +10953,27 @@ virDomainNetDefParseXML(virDomainXMLOption *xml= opt, > -=20 > - case VIR_DOMAIN_NET_TYPE_CLIENT: > - case VIR_DOMAIN_NET_TYPE_SERVER: > -+ if (path !=3D NULL) { > -+ if (port !=3D NULL || address !=3D NULL || > -+ localport !=3D NULL || localaddr !=3D NULL) { > -+ virReportError(VIR_ERR_INTERNAL_ERROR, "%s", > -+ _(" 'path' attribute " > -+ "for socket interface cannot be specif= ied " > -+ "together with other attributes")); > -+ goto error; > -+ } > -+ def->data.socket.path =3D g_steal_pointer(&path); > -+ break; > -+ } > -+ > -+ if (port =3D=3D NULL) { > -+ virReportError(VIR_ERR_INTERNAL_ERROR, "%s", > -+ _("Neither 'port' nor 'path' attrib= ute " > -+ "specified with socket interface")); > -+ goto error; > -+ } > -+ > -+ G_GNUC_FALLTHROUGH; > - case VIR_DOMAIN_NET_TYPE_MCAST: > - case VIR_DOMAIN_NET_TYPE_UDP: > - if (port =3D=3D NULL) { > -@@ -10958,7 +10982,7 @@ virDomainNetDefParseXML(virDomainXMLOption *xmlo= pt, > - "specified with socket interface")); > - goto error; > - } > -- if (virStrToLong_i(port, NULL, 10, &def->data.socket.port) < 0)= { > -+ if (virStrToLong_i(port, NULL, 10, &def->data.socket.net.port) = < 0) { > - virReportError(VIR_ERR_INTERNAL_ERROR, "%s", > - _("Cannot parse 'port' attribute " > - "with socket interface")); > -@@ -10975,7 +10999,7 @@ virDomainNetDefParseXML(virDomainXMLOption *xmlo= pt, > - goto error; > - } > - } else { > -- def->data.socket.address =3D g_steal_pointer(&address); > -+ def->data.socket.net.address =3D g_steal_pointer(&address); > - } > -=20 > - if (def->type !=3D VIR_DOMAIN_NET_TYPE_UDP) > -@@ -10987,7 +11011,8 @@ virDomainNetDefParseXML(virDomainXMLOption *xmlo= pt, > - "specified with socket interface")); > - goto error; > - } > -- if (virStrToLong_i(localport, NULL, 10, &def->data.socket.local= port) < 0) { > -+ if (virStrToLong_i(localport, NULL, 10, > -+ &def->data.socket.net.localport) < 0) { > - virReportError(VIR_ERR_INTERNAL_ERROR, "%s", > - _("Cannot parse 'port' attribute " > - "with socket interface")); > -@@ -11000,7 +11025,7 @@ virDomainNetDefParseXML(virDomainXMLOption *xmlo= pt, > - "specified with socket interface")); > - goto error; > - } else { > -- def->data.socket.localaddr =3D g_steal_pointer(&localaddr); > -+ def->data.socket.net.localaddr =3D g_steal_pointer(&localad= dr); > - } > - break; > -=20 > -@@ -25940,15 +25965,22 @@ virDomainNetDefFormat(virBuffer *buf, > -=20 > - case VIR_DOMAIN_NET_TYPE_SERVER: > - case VIR_DOMAIN_NET_TYPE_CLIENT: > -+ if (def->data.socket.path) { > -+ virBufferAsprintf(buf, " -+ def->data.socket.path); > -+ sourceLines++; > -+ break; > -+ } > -+ G_GNUC_FALLTHROUGH; > - case VIR_DOMAIN_NET_TYPE_MCAST: > - case VIR_DOMAIN_NET_TYPE_UDP: > -- if (def->data.socket.address) { > -+ if (def->data.socket.net.address) { > - virBufferAsprintf(buf, " -- def->data.socket.address, > -- def->data.socket.port); > -+ def->data.socket.net.address, > -+ def->data.socket.net.port); > - } else { > - virBufferAsprintf(buf, " -- def->data.socket.port); > -+ def->data.socket.net.port); > - } > - sourceLines++; > -=20 > -@@ -25960,8 +25992,8 @@ virDomainNetDefFormat(virBuffer *buf, > - virBufferAdjustIndent(buf, 2); > -=20 > - virBufferAsprintf(buf, "= \n", > -- def->data.socket.localaddr, > -- def->data.socket.localport); > -+ def->data.socket.net.localaddr, > -+ def->data.socket.net.localport); > - virBufferAdjustIndent(buf, -2); > - break; > -=20 > -diff --git a/src/conf/domain_conf.h b/src/conf/domain_conf.h > -index 7688f17b18cd..054b08330c8c 100644 > ---- a/src/conf/domain_conf.h > -+++ b/src/conf/domain_conf.h > -@@ -1055,11 +1055,14 @@ struct _virDomainNetDef { > - virDomainNetTeamingInfo *teaming; > - union { > - virDomainChrSourceDef *vhostuser; > -- struct { > -- char *address; > -- int port; > -- char *localaddr; > -- int localport; > -+ union { > -+ struct { > -+ char *address; > -+ int port; > -+ char *localaddr; > -+ int localport; > -+ } net; > -+ char *path; > - } socket; /* any of NET_CLIENT or NET_SERVER or NET_MCAST */ > - struct { > - char *name; > -diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c > -index 2ceff155124e..dbef58f37879 100644 > ---- a/src/qemu/qemu_command.c > -+++ b/src/qemu/qemu_command.c > -@@ -3713,37 +3713,55 @@ qemuBuildHostNetStr(virDomainNetDef *net, > - break; > -=20 > - case VIR_DOMAIN_NET_TYPE_CLIENT: > -- if (virJSONValueObjectCreate(&netprops, "s:type", "socket", NUL= L) < 0 || > -- virJSONValueObjectAppendStringPrintf(netprops, "connect", "= %s:%d", > -- net->data.socket.addre= ss, > -- net->data.socket.port)= < 0) > -+ if (virJSONValueObjectCreate(&netprops, "s:type", "socket", NUL= L) < 0) > -+ return NULL; > -+ > -+ if (net->data.socket.path !=3D NULL) { > -+ if (virJSONValueObjectAppendStringPrintf(netprops, "connect= ", "%s", > -+ net->data.socket.p= ath) < 0) > -+ return NULL; > -+ break; > -+ } > -+ > -+ if (virJSONValueObjectAppendStringPrintf(netprops, "connect", "= %s:%d", > -+ net->data.socket.net.a= ddress, > -+ net->data.socket.net.p= ort) < 0) > - return NULL; > - break; > -=20 > - case VIR_DOMAIN_NET_TYPE_SERVER: > -- if (virJSONValueObjectCreate(&netprops, "s:type", "socket", NUL= L) < 0 || > -- virJSONValueObjectAppendStringPrintf(netprops, "listen", "%= s:%d", > -- NULLSTR_EMPTY(net->dat= a.socket.address), > -- net->data.socket.port)= < 0) > -+ if (virJSONValueObjectCreate(&netprops, "s:type", "socket", NUL= L) < 0) > -+ return NULL; > -+ > -+ if (net->data.socket.path !=3D NULL) { > -+ if (virJSONValueObjectAppendStringPrintf(netprops, "listen"= , "%s", > -+ net->data.socket.p= ath) < 0) > -+ return NULL; > -+ break; > -+ } > -+ > -+ if (virJSONValueObjectAppendStringPrintf(netprops, "listen", "%= s:%d", > -+ NULLSTR_EMPTY(net->dat= a.socket.net.address), > -+ net->data.socket.net.p= ort) < 0) > - return NULL; > - break; > -=20 > - case VIR_DOMAIN_NET_TYPE_MCAST: > - if (virJSONValueObjectCreate(&netprops, "s:type", "socket", NUL= L) < 0 || > - virJSONValueObjectAppendStringPrintf(netprops, "mcast", "%s= :%d", > -- net->data.socket.addre= ss, > -- net->data.socket.port)= < 0) > -+ net->data.socket.net.a= ddress, > -+ net->data.socket.net.p= ort) < 0) > - return NULL; > - break; > -=20 > - case VIR_DOMAIN_NET_TYPE_UDP: > - if (virJSONValueObjectCreate(&netprops, "s:type", "socket", NUL= L) < 0 || > - virJSONValueObjectAppendStringPrintf(netprops, "udp", "%s:%= d", > -- net->data.socket.addre= ss, > -- net->data.socket.port)= < 0 || > -+ net->data.socket.net.a= ddress, > -+ net->data.socket.net.p= ort) < 0 || > - virJSONValueObjectAppendStringPrintf(netprops, "localaddr",= "%s:%d", > -- net->data.socket.local= addr, > -- net->data.socket.local= port) < 0) > -+ net->data.socket.net.l= ocaladdr, > -+ net->data.socket.net.l= ocalport) < 0) > - return NULL; > - break; > -=20 > -diff --git a/src/qemu/qemu_hotplug.c b/src/qemu/qemu_hotplug.c > -index 4344edc75b80..69ef7abd0ee2 100644 > ---- a/src/qemu/qemu_hotplug.c > -+++ b/src/qemu/qemu_hotplug.c > -@@ -3741,9 +3741,11 @@ qemuDomainChangeNet(virQEMUDriver *driver, > - case VIR_DOMAIN_NET_TYPE_CLIENT: > - case VIR_DOMAIN_NET_TYPE_MCAST: > - case VIR_DOMAIN_NET_TYPE_UDP: > -- if (STRNEQ_NULLABLE(olddev->data.socket.address, > -- newdev->data.socket.address) || > -- olddev->data.socket.port !=3D newdev->data.socket.port)= { > -+ if (STRNEQ_NULLABLE(olddev->data.socket.path, > -+ newdev->data.socket.path) || > -+ STRNEQ_NULLABLE(olddev->data.socket.net.address, > -+ newdev->data.socket.net.address) || > -+ olddev->data.socket.net.port !=3D newdev->data.socket.n= et.port) { > - needReconnect =3D true; > - } > - break; > ---=20 > -2.29.2 > - --=20 David Gibson | I'll have my music baroque, and my code david AT gibson.dropbear.id.au | minimalist, thank you. NOT _the_ _other_ | _way_ _around_! http://www.ozlabs.org/~dgibson --lXlPp64MvyKmkRLO Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAEBCAAdFiEEO+dNsU4E3yXUXRK2zQJF27ox2GcFAmQJEiMACgkQzQJF27ox 2Gd7cg//VweEEc462+3Pf8cKpQ80HY+0OK1HAfWDpZTaAvZ5XnfQo7Th5ZKkD0gN Y5prv4QsQD1gyg2IkAkKaZZu/yQrPurbXa4epJV+/qgVsnofX6e0RPVW3byjR91m ZscHfUD7SVK4Pz5SVMmXuI42aDxBzo/7WBZB4pl/ll+RHyD1yWZzcvhmou9QJJMR aOy5Dsp5nZ2hxv8SNV2SJ+VmQLLzXVGFuwMjOteqandDjUr9RzsgUcXb74U3hGRA lavohsgQRT7QH66iWuGFZ0pO+ryROMm4LW33kYiK6KFpSbSyHqyMbIO95YDDJb8S q9FxkZi0WahcgpaOkxqpFvt+WoNxGqzsYkz5+ytQaHu0hM0u04PDL36HAqum193H fzXmKMDotNyxCa2T6BRO8BfdMRew02pNPJZJqinDlr340vC3tlOt2zTuePjUp8CB jYN8XNO6NJxuGE1WniGcdCdNmRsRNiZ5mTYtwiXbb5W8QVY5Jtg7nXTqe2zavalO xRa88FvIqABk2VmmY7RVcvC2PUjOvzZhzlTijrwFZ89cSLv/Iftzib8bXVKzdTDR ZtOvDwpn0Q66xYU+JDL5sIGDBZagJY+mEDXAHDusDhgwuL7AlVSXJ2ttsiXOxLyV NYHspd0m+qNA2eL4Lgco0eTSYFadHpVkhpjyC/BnZE+yJHojOPY= =jxRl -----END PGP SIGNATURE----- --lXlPp64MvyKmkRLO--