From nobody Mon Feb 9 07:23:53 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; spf=pass (zohomail.com: domain of redhat.com designates 170.10.133.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=fail(p=none dis=none) header.from=126.com 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 1624873786649403.59970877855403; Mon, 28 Jun 2021 02:49:46 -0700 (PDT) Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-600-b2i9OYRBPHORILBgFV9anw-1; Mon, 28 Jun 2021 05:49:43 -0400 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id ACAD4804B83; Mon, 28 Jun 2021 09:49:36 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.20]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 8D2135D9C6; Mon, 28 Jun 2021 09:49:36 +0000 (UTC) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by colo-mx.corp.redhat.com (Postfix) with ESMTP id 3D9D91809CB2; Mon, 28 Jun 2021 09:49:36 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.rdu2.redhat.com [10.11.54.5]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 15S9nDQo008647 for ; Mon, 28 Jun 2021 05:49:13 -0400 Received: by smtp.corp.redhat.com (Postfix) id 520004C83B; Mon, 28 Jun 2021 09:49:13 +0000 (UTC) Received: from mimecast-mx02.redhat.com (mimecast06.extmail.prod.ext.rdu2.redhat.com [10.11.55.22]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 4CA884C83D for ; Mon, 28 Jun 2021 09:49:10 +0000 (UTC) Received: from us-smtp-1.mimecast.com (us-smtp-delivery-1.mimecast.com [207.211.31.120]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 8A147185A7A4 for ; Mon, 28 Jun 2021 09:49:10 +0000 (UTC) Received: from m15112.mail.126.com (m15112.mail.126.com [220.181.15.112]) by relay.mimecast.com with ESMTP id us-mta-247-WbpoCR7tODGTFQ4nOEKuyw-1; Mon, 28 Jun 2021 05:49:08 -0400 Received: from zhangjl0200.home.langchao.com (unknown [58.56.96.28]) by smtp2 (Coremail) with SMTP id DMmowAB3fVXik9lg0G6wCg--.64150S3; Mon, 28 Jun 2021 17:18:40 +0800 (CST) X-MC-Unique: b2i9OYRBPHORILBgFV9anw-1 X-MC-Unique: WbpoCR7tODGTFQ4nOEKuyw-1 From: zhangjl02 To: libvir-list@redhat.com Subject: [PATCH 1/4] qemu: interface: add qemuDomainDefIsOvsport Date: Mon, 28 Jun 2021 17:18:20 +0800 Message-Id: <20210628091823.2345-2-jx8zjs@126.com> In-Reply-To: <20210628091823.2345-1-jx8zjs@126.com> References: <20210628091823.2345-1-jx8zjs@126.com> MIME-Version: 1.0 X-CM-TRANSID: DMmowAB3fVXik9lg0G6wCg--.64150S3 X-Coremail-Antispam: 1Uf129KBjvJXoW7Aw4fJw1DXw48uFWxAFWUJwb_yoW8Gr1kpa nrJas3Jr4FgF47ZFZ3CayUuF15GryvqFnFkrW3Wr1vqr17JF1Durn3ZF1v9FyDArZxCFW7 CFW7CrWUCFn8taDanT9S1TB71UUUUUUqnTZGkaVYY2UrUUUUjbIjqfuFe4nvWSU5nxnvy2 9KBjDUYxBIdaVFxhVjvjDU0xZFpf9x07jTT5dUUUUU= X-Originating-IP: [58.56.96.28] X-CM-SenderInfo: dm0y6ybv6rjloofrz/1tbi2RC-SFpEB02RFAAAsv X-Mimecast-Impersonation-Protect: Policy=CLT - Impersonation Protection Definition; Similar Internal Domain=false; Similar Monitored External Domain=false; Custom External Domain=false; Mimecast External Domain=false; Newly Observed Domain=false; Internal User Name=false; Custom Display Name List=false; Reply-to Address Mismatch=false; Targeted Threat Dictionary=false; Mimecast Threat Dictionary=false; Custom Threat Dictionary=false X-Scanned-By: MIMEDefang 2.79 on 10.11.54.5 X-loop: libvir-list@redhat.com X-Mailman-Approved-At: Mon, 28 Jun 2021 05:49:29 -0400 Cc: zhangjl02 X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=libvir-list-bounces@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" From: zhangjl02 Tell whether a port definition is an ovs managed virtual port --- src/qemu/qemu_domain.c | 13 +++++++++++++ src/qemu/qemu_domain.h | 3 +++ 2 files changed, 16 insertions(+) diff --git a/src/qemu/qemu_domain.c b/src/qemu/qemu_domain.c index fc60e15eea..da5a226fc2 100644 --- a/src/qemu/qemu_domain.c +++ b/src/qemu/qemu_domain.c @@ -11575,3 +11575,16 @@ qemuDomainNamePathsCleanup(virQEMUDriverConfig *cf= g, =20 return 0; } + +/* + * Check whether the port is an ovs managed port + */ +bool qemuDomainDefIsOvsport(virDomainNetDef *net, + int actualType) { + const virNetDevVPortProfile *vport =3D virDomainNetGetActualVirtPortPr= ofile(net); + if ((actualType =3D=3D VIR_DOMAIN_NET_TYPE_BRIDGE) && vport && + vport->virtPortType =3D=3D VIR_NETDEV_VPORT_PROFILE_OPENVSWITCH) { + return true; + } + return false; +} \ No newline at end of file diff --git a/src/qemu/qemu_domain.h b/src/qemu/qemu_domain.h index acf6ca5ab6..81a9bf0cfb 100644 --- a/src/qemu/qemu_domain.h +++ b/src/qemu/qemu_domain.h @@ -1063,3 +1063,6 @@ int qemuDomainNamePathsCleanup(virQEMUDriverConfig *cfg, const char *name, bool bestEffort); + +bool qemuDomainDefIsOvsport(virDomainNetDef *net, + int actualType); \ No newline at end of file --=20 2.30.2.windows.1