From nobody Wed Feb 11 05:17:54 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 170.10.133.124 as permitted sender) client-ip=170.10.133.124; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-delivery-124.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.133.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1673584985; cv=none; d=zohomail.com; s=zohoarc; b=Wx7HwVyRcFE0oxB6Xiqu72VIBNpmdogNsTo3d+nUYwCzLcoy/NUdUnLd+IqOAPiw9Z1b4lCBxoE3hf+EIpFOkqg6QYAGy2FQjzGtsObs85uvif0EFy6mPrrsPGblH65HWGlC9NdIyOWt5JlXJeLab01sqSBlejqtRCkIpm6q9NU= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1673584985; h=Content-Type:Content-Transfer-Encoding:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=Td5qGWc0Y0bRiNOkEjQQaV0ueB68+jKytaj5jJNrpO0=; b=JrA6KDVsfLFU9Umt3i2UrwWu+Guq4ZebM2ixXKklIA0CaYCbIYc7FGjrhxxTg+uHne9D/KWhvnwnxj2bjC4qy46CeZVgjNaCA5bSCyKy4uDcxZN1ze+Aw+XwV/dko0G2cVJ1q78B780nKRuR2CDcA55Gsg8L7v6U3Gq1imNQ6wE= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.133.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by mx.zohomail.com with SMTPS id 1673584985931958.1465011161733; Thu, 12 Jan 2023 20:43:05 -0800 (PST) Received: from mimecast-mx02.redhat.com (mx3-rdu2.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-538-ShGYtKkZOzOkNo2ihSrrVw-1; Thu, 12 Jan 2023 23:42:26 -0500 Received: from smtp.corp.redhat.com (int-mx10.intmail.prod.int.rdu2.redhat.com [10.11.54.10]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 3514C280BCAE; Fri, 13 Jan 2023 04:42:23 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (unknown [10.30.29.100]) by smtp.corp.redhat.com (Postfix) with ESMTP id E329E492D8A; Fri, 13 Jan 2023 04:42:21 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (localhost [IPv6:::1]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id 8EF4D194705E; Fri, 13 Jan 2023 04:42:20 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.rdu2.redhat.com [10.11.54.6]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id A3A1B1946A78 for ; Fri, 13 Jan 2023 04:42:18 +0000 (UTC) Received: by smtp.corp.redhat.com (Postfix) id 871D32166B29; Fri, 13 Jan 2023 04:42:18 +0000 (UTC) Received: from vhost3.router.laine.org (unknown [10.2.16.63]) by smtp.corp.redhat.com (Postfix) with ESMTP id 67E4B2166B26 for ; Fri, 13 Jan 2023 04:42:18 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1673584985; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=Td5qGWc0Y0bRiNOkEjQQaV0ueB68+jKytaj5jJNrpO0=; b=caIxI0m436/6urdThEkWLWZQNuYw6Ac0ZTmkxARj5j+IjJYAO3geN8uUc/1RiFkKsfXZmi EtG/taR9DsBrts+wZoK84dtCGHTz/03ugAjJdc0mq94jPGdx1r1PgpOXvbFKhmZzK7EW99 DKoYNHDhHwjDZq8vC5E9Umc1VJyRDZY= X-MC-Unique: ShGYtKkZOzOkNo2ihSrrVw-1 X-Original-To: libvir-list@listman.corp.redhat.com From: Laine Stump To: libvir-list@redhat.com Subject: [libvirt PATCH 1/3] conf: remove attribute Date: Thu, 12 Jan 2023 23:42:16 -0500 Message-Id: <20230113044218.719810-2-laine@redhat.com> In-Reply-To: <20230113044218.719810-1-laine@redhat.com> References: <20230113044218.719810-1-laine@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.1 on 10.11.54.6 X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: libvir-list-bounces@redhat.com Sender: "libvir-list" X-Scanned-By: MIMEDefang 3.1 on 10.11.54.10 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1673584987037100004 Content-Type: text/plain; charset="utf-8"; x-default="true" This attribute was added to support setting the --interface option for passt, but in a post-push/pre-9.0-release review, danpb pointed out that it would be better to use the existing attribute to set --interface rather than creating a new attribute (in the wrong place). So we remove backend/upstream, and change the passt commandline creation to grab the name for --interface from source/dev. Signed-off-by: Laine Stump --- docs/formatdomain.rst | 9 +++++---- src/conf/domain_conf.c | 15 +++++++++++++-- src/conf/domain_conf.h | 1 + src/conf/schemas/domaincommon.rng | 13 ++++++++----- src/qemu/qemu_passt.c | 4 ++-- tests/qemuxml2argvdata/net-user-passt.xml | 3 ++- 6 files changed, 31 insertions(+), 14 deletions(-) diff --git a/docs/formatdomain.rst b/docs/formatdomain.rst index 2c44f77ab6..490a954745 100644 --- a/docs/formatdomain.rst +++ b/docs/formatdomain.rst @@ -4821,9 +4821,9 @@ destined for the host toward the guest instead. =20 When the passt backend is used, the ```` attribute ``logFile`` can be used to tell the passt process for this interface -where to write its message log, and the ```` attribute -``upstream`` can tell it to restrict upstream traffic to a particular -host interface. +where to write its message log, and the ```` attribute ``dev`` +can tell it to use a particular host interface to derive the routes +given to the guest for forwarding traffic upstream. =20 Additionally, when passt is used, multiple ```` elements can be added to forward incoming network traffic for the host to this @@ -4855,8 +4855,9 @@ ports **with the exception of some subset**. ... - + + diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c index e43dee1a60..5379204f89 100644 --- a/src/conf/domain_conf.c +++ b/src/conf/domain_conf.c @@ -9038,7 +9038,6 @@ virDomainNetBackendParseXML(xmlNodePtr node, } =20 def->backend.logFile =3D virXMLPropString(node, "logFile"); - def->backend.upstream =3D virXMLPropString(node, "upstream"); =20 if (tap) def->backend.tap =3D virFileSanitizePath(tap); @@ -9464,6 +9463,9 @@ virDomainNetDefParseXML(virDomainXMLOption *xmlopt, break; =20 case VIR_DOMAIN_NET_TYPE_USER: + def->sourceDev =3D virXMLPropString(source_node, "dev"); + break; + case VIR_DOMAIN_NET_TYPE_NULL: case VIR_DOMAIN_NET_TYPE_LAST: break; @@ -23277,6 +23279,9 @@ virDomainActualNetDefContentsFormat(virBuffer *buf, return -1; } virBufferAsprintf(buf, " mode=3D'%s'", mode); + } else if (actualType =3D=3D VIR_DOMAIN_NET_TYPE_USER) { + + virBufferEscapeString(buf, " dev=3D'%s'", def->sourceDev); } =20 virBufferAddLit(buf, "/>\n"); @@ -23487,7 +23492,6 @@ virDomainNetBackendFormat(virBuffer *buf, virBufferEscapeString(&attrBuf, " tap=3D'%s'", backend->tap); virBufferEscapeString(&attrBuf, " vhost=3D'%s'", backend->vhost); virBufferEscapeString(&attrBuf, " logFile=3D'%s'", backend->logFile); - virBufferEscapeString(&attrBuf, " upstream=3D'%s'", backend->upstream); virXMLFormatElement(buf, "backend", &attrBuf, NULL); } =20 @@ -23752,6 +23756,13 @@ virDomainNetDefFormat(virBuffer *buf, } =20 case VIR_DOMAIN_NET_TYPE_USER: + if (def->backend.type =3D=3D VIR_DOMAIN_NET_BACKEND_PASST && + def->sourceDev) { + virBufferEscapeString(buf, "sour= ceDev); + sourceLines++; + } + break; + case VIR_DOMAIN_NET_TYPE_NULL: case VIR_DOMAIN_NET_TYPE_LAST: break; diff --git a/src/conf/domain_conf.h b/src/conf/domain_conf.h index 60fc7c4eb2..3e4985a67d 100644 --- a/src/conf/domain_conf.h +++ b/src/conf/domain_conf.h @@ -1192,6 +1192,7 @@ struct _virDomainNetDef { virNetDevIPInfo hostIP; char *ifname_guest_actual; char *ifname_guest; + char *sourceDev; virNetDevIPInfo guestIP; size_t nPortForwards; virDomainNetPortForward **portForwards; diff --git a/src/conf/schemas/domaincommon.rng b/src/conf/schemas/domaincom= mon.rng index bd2e789327..6cb0a20e1e 100644 --- a/src/conf/schemas/domaincommon.rng +++ b/src/conf/schemas/domaincommon.rng @@ -3318,6 +3318,14 @@ user + + + + + + + + @@ -3643,11 +3651,6 @@ - - - - - diff --git a/src/qemu/qemu_passt.c b/src/qemu/qemu_passt.c index a7ee841af7..b1215a1bba 100644 --- a/src/qemu/qemu_passt.c +++ b/src/qemu/qemu_passt.c @@ -167,8 +167,8 @@ qemuPasstStart(virDomainObj *vm, virCommandAddArgFormat(cmd, "%u", net->mtu); } =20 - if (net->backend.upstream) - virCommandAddArgList(cmd, "--interface", net->backend.upstream, NU= LL); + if (net->sourceDev) + virCommandAddArgList(cmd, "--interface", net->sourceDev, NULL); =20 if (net->backend.logFile) virCommandAddArgList(cmd, "--log-file", net->backend.logFile, NULL= ); diff --git a/tests/qemuxml2argvdata/net-user-passt.xml b/tests/qemuxml2argv= data/net-user-passt.xml index b82eebd089..20c9f50542 100644 --- a/tests/qemuxml2argvdata/net-user-passt.xml +++ b/tests/qemuxml2argvdata/net-user-passt.xml @@ -27,6 +27,7 @@ + @@ -46,7 +47,7 @@ - +
--=20 2.38.1