From nobody Tue Nov 26 14:41:44 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of redhat.com designates 205.139.110.61 as permitted sender) client-ip=205.139.110.61; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-delivery-1.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zoho.com: domain of redhat.com designates 205.139.110.61 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=1571793959; cv=none; d=zoho.com; s=zohoarc; b=RlAxkyIdkMcMe1ao8kCC4XX6fJEVuXcGU9eg45K2Lc32eLyl9HGhGUteNLst9yvblKZQV//PtA2NPZvSOeObc2eUOBTkwil8GWWqsfoMywUL/PUqflSdvbkjlO3I8w8sdes1shoCPwf9QzY2wEb5/u4DLXBGWPIQXbjyawB2OdU= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1571793959; 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=sXIdgDw5yUHrNCtwr/XqcWX7myXjXQwXEiWbn0X+d84=; b=oU148/J06d0eV+WVZuDT5cIrRIiuNFyFBhGf04ybFTi7iHVCPQXQQgBSwM/6mbB93Tp5miIDmxZgsBPE00uEw9tcJriYARnu/TJNaqcz6btc6YVvrlCedTGyOSPeh1VFt4cFuFercjOI45hHZrpyMBkrlgahK75fixqulw3hQoI= ARC-Authentication-Results: i=1; mx.zoho.com; dkim=pass; spf=pass (zoho.com: domain of redhat.com designates 205.139.110.61 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from us-smtp-delivery-1.mimecast.com (us-smtp-1.mimecast.com [205.139.110.61]) by mx.zohomail.com with SMTPS id 1571793959761901.2097460127364; Tue, 22 Oct 2019 18:25:59 -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-360-32CDVeLSPAS5UFP0nomPTQ-1; Tue, 22 Oct 2019 21:25:56 -0400 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 5B60B1005500; Wed, 23 Oct 2019 01:25:51 +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 49FCB5C1D6; Wed, 23 Oct 2019 01:25:49 +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 304C4180085A; Wed, 23 Oct 2019 01:25:47 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id x9N1ORNg030872 for ; Tue, 22 Oct 2019 21:24:27 -0400 Received: by smtp.corp.redhat.com (Postfix) id DF9EA5B69A; Wed, 23 Oct 2019 01:24:27 +0000 (UTC) Received: from vhost2.laine.org (ovpn-117-114.phx2.redhat.com [10.3.117.114]) by smtp.corp.redhat.com (Postfix) with ESMTP id 9D6F95D6C8 for ; Wed, 23 Oct 2019 01:24:27 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1571793958; 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=sXIdgDw5yUHrNCtwr/XqcWX7myXjXQwXEiWbn0X+d84=; b=Bawk8EdUIvxW0Ltf9x0zIHLjyHTk2As3/wBfJ3tT0kBWVN/uYENsuDo5jr2ZixPc19VQ61 eKgdklGAoU3hnxth6TQiASdYPWDcgInLPW8VgTLQxjoFlZAVEYA5HbLlp6PAn0bRNHEFM/ k8fwJ1c3jpkZgPIJb/mntKgBP3VIQ5w= From: Laine Stump To: libvir-list@redhat.com Date: Tue, 22 Oct 2019 21:24:14 -0400 Message-Id: <20191023012420.21128-2-laine@redhat.com> In-Reply-To: <20191023012420.21128-1-laine@redhat.com> References: <20191023012420.21128-1-laine@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH 1/7] qemu: add mac address to error messages in qemuDomainValidateActualNetDef 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.16 X-MC-Unique: 32CDVeLSPAS5UFP0nomPTQ-1 X-Mimecast-Spam-Score: 0 Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) Content-Type: text/plain; charset="utf-8" This makes it easier to understand which interface's config caused the error. Signed-off-by: Laine Stump --- src/qemu/qemu_domain.c | 27 ++++++++++++++++----------- 1 file changed, 16 insertions(+), 11 deletions(-) diff --git a/src/qemu/qemu_domain.c b/src/qemu/qemu_domain.c index 3e8da13794..b2e8759da7 100644 --- a/src/qemu/qemu_domain.c +++ b/src/qemu/qemu_domain.c @@ -5384,8 +5384,11 @@ qemuDomainValidateActualNetDef(const virDomainNetDef= *net, * time), but only if the validations would SUCCEED for * type=3D'network'.) */ + char macstr[VIR_MAC_STRING_BUFLEN]; virDomainNetType actualType =3D virDomainNetGetActualType(net); =20 + virMacAddrFormat(&net->mac, macstr); + /* Only tap/macvtap devices support multiqueue. */ if (net->driver.virtio.queues > 0) { =20 @@ -5395,17 +5398,18 @@ qemuDomainValidateActualNetDef(const virDomainNetDe= f *net, actualType =3D=3D VIR_DOMAIN_NET_TYPE_ETHERNET || actualType =3D=3D VIR_DOMAIN_NET_TYPE_VHOSTUSER)) { virReportError(VIR_ERR_CONFIG_UNSUPPORTED, - _("multiqueue network is not supported for: %s"= ), - virDomainNetTypeToString(actualType)); + _("interface %s - multiqueue network is not sup= ported for: %s"), + macstr, virDomainNetTypeToString(actualType)); return -1; } =20 if (net->driver.virtio.queues > 1 && actualType =3D=3D VIR_DOMAIN_NET_TYPE_VHOSTUSER && !virQEMUCapsGet(qemuCaps, QEMU_CAPS_VHOSTUSER_MULTIQUEUE)) { - virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s", - _("multiqueue network is not supported for vhos= t-user " - "with this QEMU binary")); + virReportError(VIR_ERR_CONFIG_UNSUPPORTED, + _("interface %s - multiqueue network is " + "not supported for vhost-user with this QEMU = binary"), + macstr); return -1; } } @@ -5417,21 +5421,22 @@ qemuDomainValidateActualNetDef(const virDomainNetDe= f *net, */ if (net->filter) { virNetDevVPortProfilePtr vport =3D virDomainNetGetActualVirtPortPr= ofile(net); + if (!(actualType =3D=3D VIR_DOMAIN_NET_TYPE_NETWORK || actualType =3D=3D VIR_DOMAIN_NET_TYPE_BRIDGE || actualType =3D=3D VIR_DOMAIN_NET_TYPE_ETHERNET)) { virReportError(VIR_ERR_CONFIG_UNSUPPORTED, - _("filterref is not supported for " + _("interface %s - filterref is not supported fo= r " "network interfaces of type %s"), - virDomainNetTypeToString(actualType)); + macstr, virDomainNetTypeToString(actualType)); return -1; } if (vport && vport->virtPortType !=3D VIR_NETDEV_VPORT_PROFILE_NON= E) { /* currently none of the defined virtualport types support ipt= ables */ virReportError(VIR_ERR_CONFIG_UNSUPPORTED, - _("filterref is not supported for " + _("interface %s - filterref is not supported fo= r " "network interfaces with virtualport type %s"= ), - virNetDevVPortTypeToString(vport->virtPortType)= ); + macstr, virNetDevVPortTypeToString(vport->virtP= ortType)); return -1; } } @@ -5441,8 +5446,8 @@ qemuDomainValidateActualNetDef(const virDomainNetDef = *net, actualType =3D=3D VIR_DOMAIN_NET_TYPE_BRIDGE || actualType =3D=3D VIR_DOMAIN_NET_TYPE_ETHERNET)) { virReportError(VIR_ERR_CONFIG_UNSUPPORTED, - _("Custom tap device path is not supported for: %s"= ), - virDomainNetTypeToString(actualType)); + _("interface %s - custom tap device path is not sup= ported for: %s"), + macstr, virDomainNetTypeToString(actualType)); return -1; } =20 --=20 2.21.0 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Tue Nov 26 14:41:44 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of redhat.com designates 205.139.110.120 as permitted sender) client-ip=205.139.110.120; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-1.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zoho.com: domain of redhat.com designates 205.139.110.120 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=1571794007; cv=none; d=zoho.com; s=zohoarc; b=WdRBZ6YC8CBYtwnqFTqTWIu/hIQYN4ZF94Jko1gIJZfQtYz1MezxxO5u8/I1ItCV+mtL0no6xWcDwwd9tUs3sg/qGN1dSp8YLqhMbDWydNKcKskTB75Kk4G7Pz6D0A9O7yhzuTQb/0HM2AwOHCSIHkOuLcJwFPSyENQcz+s983c= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1571794007; 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=ATdDBpVKsaeMjP/UlW4MJVfvC2SBvdjzhsh20REHf0M=; b=BbDLankCQHu57nMEw0Co42IJFhp4CDT9PBx6MUbzkCnZH+xSkWwjhnuoRkFHWEWeayfPp4CrV4MN7vQsw28I5gGmBHBp9fs6p1mb+3j38uhs1ZXOrjRfnw8QnSqkCF6rOhlWe249IwQZKXeSLA3IvA2YUaeNK2EsxHlPH9/FFFQ= ARC-Authentication-Results: i=1; mx.zoho.com; dkim=pass; spf=pass (zoho.com: domain of redhat.com designates 205.139.110.120 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from us-smtp-1.mimecast.com (us-smtp-delivery-1.mimecast.com [205.139.110.120]) by mx.zohomail.com with SMTPS id 1571794007836762.3011672960572; Tue, 22 Oct 2019 18:26:47 -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-280-1cEiDjcMPQGfrEZJ1YhYnA-1; Tue, 22 Oct 2019 21:26:45 -0400 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 731BA5E9; Wed, 23 Oct 2019 01:26:40 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.21]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 4C27F1001DD7; Wed, 23 Oct 2019 01:26:40 +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 0BDD14E58C; Wed, 23 Oct 2019 01:26:40 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id x9N1OSaj030877 for ; Tue, 22 Oct 2019 21:24:28 -0400 Received: by smtp.corp.redhat.com (Postfix) id 69E5B5D6C8; Wed, 23 Oct 2019 01:24:28 +0000 (UTC) Received: from vhost2.laine.org (ovpn-117-114.phx2.redhat.com [10.3.117.114]) by smtp.corp.redhat.com (Postfix) with ESMTP id 1584B5D6B2 for ; Wed, 23 Oct 2019 01:24:27 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1571794006; 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=ATdDBpVKsaeMjP/UlW4MJVfvC2SBvdjzhsh20REHf0M=; b=Dj/fPH5y8MVWpvGwtRFX7epVfeYW+rWbHPKx3hMHhpHFn0Myt9JWIkZQU95CRm1NJuJ4gj TkId9xV/8tPsIa3Enlost/DuJht62bjJl4H55oE6mATILruX9OWKlkkLgv/VyI2VVMoeiT YHSJ29eu84iroQ9HM6/ZvMQ1hg41Shk= From: Laine Stump To: libvir-list@redhat.com Date: Tue, 22 Oct 2019 21:24:15 -0400 Message-Id: <20191023012420.21128-3-laine@redhat.com> In-Reply-To: <20191023012420.21128-1-laine@redhat.com> References: <20191023012420.21128-1-laine@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH 2/7] conf: make virDomainNetGetActualVlan arg/return val const 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.84 on 10.5.11.22 X-MC-Unique: 1cEiDjcMPQGfrEZJ1YhYnA-1 X-Mimecast-Spam-Score: 0 Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) Content-Type: text/plain; charset="utf-8" This is needed if we want to call the function when the virDomainNetDef* we have is a const. Since virDomainNetGetActualVlan returns a pointer to memory that is within the virDomainNetDefPtr arg, the returned pointer must also be made const. This leads to a cascade of other virNetDevVlanPtr's that must be changed to "const virNetDevVlan *". Signed-off-by: Laine Stump --- src/conf/domain_conf.c | 6 +++--- src/conf/domain_conf.h | 2 +- src/libxl/libxl_conf.c | 2 +- src/libxl/xen_common.c | 2 +- src/util/virhostdev.c | 2 +- src/util/virnetdev.c | 4 ++-- src/util/virnetdev.h | 2 +- src/util/virnetdevmacvlan.c | 4 ++-- src/util/virnetdevmacvlan.h | 2 +- src/util/virnetdevopenvswitch.c | 6 +++--- src/util/virnetdevopenvswitch.h | 4 ++-- src/util/virnetdevtap.c | 6 +++--- src/util/virnetdevtap.h | 6 +++--- tests/bhyvexml2argvmock.c | 2 +- 14 files changed, 25 insertions(+), 25 deletions(-) diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c index 80e19a15df..c0122dfd07 100644 --- a/src/conf/domain_conf.c +++ b/src/conf/domain_conf.c @@ -29710,10 +29710,10 @@ virDomainNetGetActualBandwidth(virDomainNetDefPtr= iface) return iface->bandwidth; } =20 -virNetDevVlanPtr -virDomainNetGetActualVlan(virDomainNetDefPtr iface) +const virNetDevVlan * +virDomainNetGetActualVlan(const virDomainNetDef *iface) { - virNetDevVlanPtr vlan =3D &iface->vlan; + const virNetDevVlan *vlan =3D &iface->vlan; =20 /* if there is an ActualNetDef, *always* return * its vlan rather than the NetDef's vlan. diff --git a/src/conf/domain_conf.h b/src/conf/domain_conf.h index a481389925..9ca3a5bf06 100644 --- a/src/conf/domain_conf.h +++ b/src/conf/domain_conf.h @@ -3213,7 +3213,7 @@ virNetDevVPortProfilePtr virDomainNetGetActualVirtPortProfile(const virDomainNetDef *iface); virNetDevBandwidthPtr virDomainNetGetActualBandwidth(virDomainNetDefPtr iface); -virNetDevVlanPtr virDomainNetGetActualVlan(virDomainNetDefPtr iface); +const virNetDevVlan *virDomainNetGetActualVlan(const virDomainNetDef *ifac= e); bool virDomainNetGetActualTrustGuestRxFilters(virDomainNetDefPtr iface); const char *virDomainNetGetModelString(const virDomainNetDef *net); int virDomainNetSetModelString(virDomainNetDefPtr et, diff --git a/src/libxl/libxl_conf.c b/src/libxl/libxl_conf.c index 3f08f0f710..89122826fc 100644 --- a/src/libxl/libxl_conf.c +++ b/src/libxl/libxl_conf.c @@ -1218,7 +1218,7 @@ libxlMakeNic(virDomainDefPtr def, virConnectPtr conn =3D NULL; virNetDevBandwidthPtr actual_bw; virNetDevVPortProfilePtr port_profile; - virNetDevVlanPtr virt_vlan; + const virNetDevVlan *virt_vlan; virBuffer buf =3D VIR_BUFFER_INITIALIZER; size_t i; const char *script =3D NULL; diff --git a/src/libxl/xen_common.c b/src/libxl/xen_common.c index cc9039a0cf..6e77921333 100644 --- a/src/libxl/xen_common.c +++ b/src/libxl/xen_common.c @@ -1681,7 +1681,7 @@ xenFormatNet(virConnectPtr conn, case VIR_DOMAIN_NET_TYPE_BRIDGE: { virNetDevVPortProfilePtr port_profile =3D virDomainNetGetActualVir= tPortProfile(net); - virNetDevVlanPtr virt_vlan =3D virDomainNetGetActualVlan(net); + const virNetDevVlan *virt_vlan =3D virDomainNetGetActualVlan(net); const char *script =3D net->script; size_t i; =20 diff --git a/src/util/virhostdev.c b/src/util/virhostdev.c index 010eb551a9..223a78bd34 100644 --- a/src/util/virhostdev.c +++ b/src/util/virhostdev.c @@ -501,7 +501,7 @@ virHostdevSetNetConfig(virDomainHostdevDefPtr hostdev, const unsigned char *uuid) { g_autofree char *linkdev =3D NULL; - virNetDevVlanPtr vlan; + const virNetDevVlan *vlan; virNetDevVPortProfilePtr virtPort; int vf =3D -1; bool port_profile_associate =3D true; diff --git a/src/util/virnetdev.c b/src/util/virnetdev.c index 5391f0030b..7adc69905d 100644 --- a/src/util/virnetdev.c +++ b/src/util/virnetdev.c @@ -2178,7 +2178,7 @@ virNetDevReadNetConfig(const char *linkdev, int vf, int virNetDevSetNetConfig(const char *linkdev, int vf, const virMacAddr *adminMAC, - virNetDevVlanPtr vlan, + const virNetDevVlan *vlan, const virMacAddr *MAC, bool setVlan) { @@ -2401,7 +2401,7 @@ int virNetDevSetNetConfig(const char *linkdev G_GNUC_UNUSED, int vf G_GNUC_UNUSED, const virMacAddr *adminMAC G_GNUC_UNUSED, - virNetDevVlanPtr vlan G_GNUC_UNUSED, + const virNetDevVlan *vlan G_GNUC_UNUSED, const virMacAddr *MAC G_GNUC_UNUSED, bool setVlan G_GNUC_UNUSED) { diff --git a/src/util/virnetdev.h b/src/util/virnetdev.h index b5a5214bcb..24b41498ed 100644 --- a/src/util/virnetdev.h +++ b/src/util/virnetdev.h @@ -253,7 +253,7 @@ virNetDevReadNetConfig(const char *linkdev, int vf, int virNetDevSetNetConfig(const char *linkdev, int vf, const virMacAddr *adminMAC, - virNetDevVlanPtr vlan, + const virNetDevVlan *vlan, const virMacAddr *MAC, bool setVLan) ATTRIBUTE_NONNULL(1) G_GNUC_WARN_UNUSED_RESULT; diff --git a/src/util/virnetdevmacvlan.c b/src/util/virnetdevmacvlan.c index 2ccd83d1bb..c530cb75ed 100644 --- a/src/util/virnetdevmacvlan.c +++ b/src/util/virnetdevmacvlan.c @@ -895,7 +895,7 @@ virNetDevMacVLanCreateWithVPortProfile(const char *ifna= meRequested, const virMacAddr *macaddress, const char *linkdev, virNetDevMacVLanMode mode, - virNetDevVlanPtr vlan, + const virNetDevVlan *vlan, const unsigned char *vmuuid, virNetDevVPortProfilePtr virtPortPr= ofile, char **ifnameResult, @@ -1224,7 +1224,7 @@ int virNetDevMacVLanCreateWithVPortProfile(const char= *ifname G_GNUC_UNUSED, const virMacAddr *macaddress G_= GNUC_UNUSED, const char *linkdev G_GNUC_UNUS= ED, virNetDevMacVLanMode mode G_GNU= C_UNUSED, - virNetDevVlanPtr vlan G_GNUC_UN= USED, + const virNetDevVlan *vlan G_GNU= C_UNUSED, const unsigned char *vmuuid G_G= NUC_UNUSED, virNetDevVPortProfilePtr virtPo= rtProfile G_GNUC_UNUSED, char **res_ifname G_GNUC_UNUSED, diff --git a/src/util/virnetdevmacvlan.h b/src/util/virnetdevmacvlan.h index 30038a45b5..f455ec3384 100644 --- a/src/util/virnetdevmacvlan.h +++ b/src/util/virnetdevmacvlan.h @@ -76,7 +76,7 @@ int virNetDevMacVLanCreateWithVPortProfile(const char *if= name, const virMacAddr *macaddress, const char *linkdev, virNetDevMacVLanMode mode, - virNetDevVlanPtr vlan, + const virNetDevVlan *vlan, const unsigned char *vmuuid, virNetDevVPortProfilePtr virtPo= rtProfile, char **res_ifname, diff --git a/src/util/virnetdevopenvswitch.c b/src/util/virnetdevopenvswitc= h.c index 1d2bbf9dd7..9aa2c5ad84 100644 --- a/src/util/virnetdevopenvswitch.c +++ b/src/util/virnetdevopenvswitch.c @@ -68,7 +68,7 @@ virNetDevOpenvswitchAddTimeout(virCommandPtr cmd) * Returns 0 in case of success or -1 in case of failure. */ static int -virNetDevOpenvswitchConstructVlans(virCommandPtr cmd, virNetDevVlanPtr vir= tVlan) +virNetDevOpenvswitchConstructVlans(virCommandPtr cmd, const virNetDevVlan = *virtVlan) { int ret =3D -1; size_t i =3D 0; @@ -136,7 +136,7 @@ int virNetDevOpenvswitchAddPort(const char *brname, con= st char *ifname, const virMacAddr *macaddr, const unsigned char *vmuuid, virNetDevVPortProfilePtr ovsport, - virNetDevVlanPtr virtVlan) + const virNetDevVlan *virtVlan) { char macaddrstr[VIR_MAC_STRING_BUFLEN]; char ifuuidstr[VIR_UUID_STRING_BUFLEN]; @@ -547,7 +547,7 @@ virNetDevOpenvswitchGetVhostuserIfname(const char *path, * Returns 0 in case of success or -1 in case of failure. */ int virNetDevOpenvswitchUpdateVlan(const char *ifname, - virNetDevVlanPtr virtVlan) + const virNetDevVlan *virtVlan) { g_autoptr(virCommand) cmd =3D NULL; =20 diff --git a/src/util/virnetdevopenvswitch.h b/src/util/virnetdevopenvswitc= h.h index 2e15384b5f..dddb21a5a2 100644 --- a/src/util/virnetdevopenvswitch.h +++ b/src/util/virnetdevopenvswitch.h @@ -33,7 +33,7 @@ int virNetDevOpenvswitchAddPort(const char *brname, const virMacAddr *macaddr, const unsigned char *vmuuid, virNetDevVPortProfilePtr ovsport, - virNetDevVlanPtr virtVlan) + const virNetDevVlan *virtVlan) ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2) ATTRIBUTE_NONNULL(3) G_GNUC_WARN_UNUSED_RESULT; =20 @@ -65,5 +65,5 @@ int virNetDevOpenvswitchGetVhostuserIfname(const char *pa= th, ATTRIBUTE_NONNULL(2) G_GNUC_WARN_UNUSED_RESULT G_GNUC_NO_INLINE; =20 int virNetDevOpenvswitchUpdateVlan(const char *ifname, - virNetDevVlanPtr virtVlan) + const virNetDevVlan *virtVlan) ATTRIBUTE_NONNULL(1) G_GNUC_WARN_UNUSED_RESULT; diff --git a/src/util/virnetdevtap.c b/src/util/virnetdevtap.c index fe4f55f8fc..fa1626d6ba 100644 --- a/src/util/virnetdevtap.c +++ b/src/util/virnetdevtap.c @@ -503,7 +503,7 @@ virNetDevTapAttachBridge(const char *tapname, const virMacAddr *macaddr, const unsigned char *vmuuid, virNetDevVPortProfilePtr virtPortProfile, - virNetDevVlanPtr virtVlan, + const virNetDevVlan *virtVlan, unsigned int mtu, unsigned int *actualMTU) { @@ -575,7 +575,7 @@ virNetDevTapReattachBridge(const char *tapname, const virMacAddr *macaddr, const unsigned char *vmuuid, virNetDevVPortProfilePtr virtPortProfile, - virNetDevVlanPtr virtVlan, + const virNetDevVlan *virtVlan, unsigned int mtu, unsigned int *actualMTU) { @@ -661,7 +661,7 @@ int virNetDevTapCreateInBridgePort(const char *brname, int *tapfd, size_t tapfdSize, virNetDevVPortProfilePtr virtPortProfil= e, - virNetDevVlanPtr virtVlan, + const virNetDevVlan *virtVlan, virNetDevCoalescePtr coalesce, unsigned int mtu, unsigned int *actualMTU, diff --git a/src/util/virnetdevtap.h b/src/util/virnetdevtap.h index cbc799bdbe..4fc734fd5e 100644 --- a/src/util/virnetdevtap.h +++ b/src/util/virnetdevtap.h @@ -64,7 +64,7 @@ virNetDevTapAttachBridge(const char *tapname, const virMacAddr *macaddr, const unsigned char *vmuuid, virNetDevVPortProfilePtr virtPortProfile, - virNetDevVlanPtr virtVlan, + const virNetDevVlan *virtVlan, unsigned int mtu, unsigned int *actualMTU) ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2) ATTRIBUTE_NONNULL(3) @@ -76,7 +76,7 @@ virNetDevTapReattachBridge(const char *tapname, const virMacAddr *macaddr, const unsigned char *vmuuid, virNetDevVPortProfilePtr virtPortProfile, - virNetDevVlanPtr virtVlan, + const virNetDevVlan *virtVlan, unsigned int mtu, unsigned int *actualMTU) ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2) ATTRIBUTE_NONNULL(3) @@ -90,7 +90,7 @@ int virNetDevTapCreateInBridgePort(const char *brname, int *tapfd, size_t tapfdSize, virNetDevVPortProfilePtr virtPortProfil= e, - virNetDevVlanPtr virtVlan, + const virNetDevVlan *virtVlan, virNetDevCoalescePtr coalesce, unsigned int mtu, unsigned int *actualMTU, diff --git a/tests/bhyvexml2argvmock.c b/tests/bhyvexml2argvmock.c index b0d38187f9..ac4ffe8596 100644 --- a/tests/bhyvexml2argvmock.c +++ b/tests/bhyvexml2argvmock.c @@ -27,7 +27,7 @@ int virNetDevTapCreateInBridgePort(const char *brname G_G= NUC_UNUSED, int *tapfd G_GNUC_UNUSED, size_t tapfdSize G_GNUC_UNUSED, virNetDevVPortProfilePtr virtPortProfil= e G_GNUC_UNUSED, - virNetDevVlanPtr virtVlan G_GNUC_UNUSED, + const virNetDevVlan *virtVlan G_GNUC_UN= USED, virNetDevCoalescePtr coalesce G_GNUC_UN= USED, unsigned int mtu G_GNUC_UNUSED, unsigned int *actualMTU G_GNUC_UNUSED, --=20 2.21.0 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Tue Nov 26 14:41:44 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of redhat.com designates 207.211.31.81 as permitted sender) client-ip=207.211.31.81; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-delivery-1.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zoho.com: domain of redhat.com designates 207.211.31.81 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=1571794092; cv=none; d=zoho.com; s=zohoarc; b=PC4Dh8A5GCFPVR/g8kZtrClpndu4dbArF4M0RCINXOtqMrEQB5hLEbpNc7Ez2Rgn22BgZsLF58byjnq4t7GLRqV/wum9vy/N2rfqC/tfUXBWljm89kKW0N7kVZOgw+n5yGffDm3po0+u4nyjRvENmcQPJUAWaJWj/eHv/5DaSsE= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1571794092; 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=ZNA4phQERT1BWdEhGtPmmH2TQ249xBuy85NFXPBUiI4=; b=kFq4MPMXiYhCq0tjKciK2fVr8SXpZjQwQwK2iEY9wrVzB2nvqZcXxm4hs2dYsAhxGTcUNnSPN3JreWya5bSwTFenxDmUkMu9SUZkXWo0RjUNE1YoN0mnHkMy83q9SjFFikNz9JyF8J2s3s/YaVK9k1RIk46TZLEfD3zYceDPAhI= ARC-Authentication-Results: i=1; mx.zoho.com; dkim=pass; spf=pass (zoho.com: domain of redhat.com designates 207.211.31.81 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from us-smtp-delivery-1.mimecast.com (us-smtp-2.mimecast.com [207.211.31.81]) by mx.zohomail.com with SMTPS id 1571794092100178.85039338044646; Tue, 22 Oct 2019 18:28:12 -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-116-EaFYNTwFO6ufjZV5GJhrpA-1; Tue, 22 Oct 2019 21:26:49 -0400 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 26936107AD36; Wed, 23 Oct 2019 01:26:44 +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 F288560C5E; Wed, 23 Oct 2019 01:26:43 +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 A86DA18037CA; Wed, 23 Oct 2019 01:26:43 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id x9N1OS9m030883 for ; Tue, 22 Oct 2019 21:24:28 -0400 Received: by smtp.corp.redhat.com (Postfix) id D7A075D6C8; Wed, 23 Oct 2019 01:24:28 +0000 (UTC) Received: from vhost2.laine.org (ovpn-117-114.phx2.redhat.com [10.3.117.114]) by smtp.corp.redhat.com (Postfix) with ESMTP id 951875D6B2 for ; Wed, 23 Oct 2019 01:24:28 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1571794091; 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=ZNA4phQERT1BWdEhGtPmmH2TQ249xBuy85NFXPBUiI4=; b=b5HYpQE+pad6o8YtDe3FKcPAr5GcNrOIzRn+nEGQsDuQ519QihXx8yPA6WkgRGsrsutmp+ p2JwAZlhpWhuq64jJeHT4xEcPZOV8UiZhS61SDKWfnG6BdDvhJauO5wandv5TdP4isYoNz SWpYYvPdvqBF7kB3g0m5LIqarCQ3opI= From: Laine Stump To: libvir-list@redhat.com Date: Tue, 22 Oct 2019 21:24:16 -0400 Message-Id: <20191023012420.21128-4-laine@redhat.com> In-Reply-To: <20191023012420.21128-1-laine@redhat.com> References: <20191023012420.21128-1-laine@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH 3/7] conf: make virDomainNetGetActualBandwidth arg/return value const 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.12 X-MC-Unique: EaFYNTwFO6ufjZV5GJhrpA-1 X-Mimecast-Spam-Score: 0 Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) Content-Type: text/plain; charset="utf-8" In this case, the virNetDevBandwidthPtr that is returned is not to a region within the virDomainNetDef arg, but points elsewhere (the NetDef has the pointer, not the entire object), so technically it's not necessary to make the return value a const, but it's a bit disingenuous to *not* do it. Signed-off-by: Laine Stump --- src/conf/domain_conf.c | 4 ++-- src/conf/domain_conf.h | 4 ++-- src/conf/netdev_bandwidth_conf.c | 2 +- src/conf/netdev_bandwidth_conf.h | 2 +- src/libxl/libxl_conf.c | 2 +- src/lxc/lxc_driver.c | 2 +- src/lxc/lxc_process.c | 4 ++-- src/qemu/qemu_command.c | 2 +- src/qemu/qemu_hotplug.c | 4 ++-- src/util/virnetdevbandwidth.c | 6 +++--- src/util/virnetdevbandwidth.h | 4 ++-- 11 files changed, 18 insertions(+), 18 deletions(-) diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c index c0122dfd07..76e036c48e 100644 --- a/src/conf/domain_conf.c +++ b/src/conf/domain_conf.c @@ -29698,8 +29698,8 @@ virDomainNetGetActualVirtPortProfile(const virDomai= nNetDef *iface) } } =20 -virNetDevBandwidthPtr -virDomainNetGetActualBandwidth(virDomainNetDefPtr iface) +const virNetDevBandwidth * +virDomainNetGetActualBandwidth(const virDomainNetDef *iface) { /* if there is an ActualNetDef, *always* return * its bandwidth rather than the NetDef's bandwidth. diff --git a/src/conf/domain_conf.h b/src/conf/domain_conf.h index 9ca3a5bf06..44d5fb8e16 100644 --- a/src/conf/domain_conf.h +++ b/src/conf/domain_conf.h @@ -3211,8 +3211,8 @@ int virDomainNetGetActualDirectMode(virDomainNetDefPt= r iface); virDomainHostdevDefPtr virDomainNetGetActualHostdev(virDomainNetDefPtr ifa= ce); virNetDevVPortProfilePtr virDomainNetGetActualVirtPortProfile(const virDomainNetDef *iface); -virNetDevBandwidthPtr -virDomainNetGetActualBandwidth(virDomainNetDefPtr iface); +const virNetDevBandwidth * +virDomainNetGetActualBandwidth(const virDomainNetDef *iface); const virNetDevVlan *virDomainNetGetActualVlan(const virDomainNetDef *ifac= e); bool virDomainNetGetActualTrustGuestRxFilters(virDomainNetDefPtr iface); const char *virDomainNetGetModelString(const virDomainNetDef *net); diff --git a/src/conf/netdev_bandwidth_conf.c b/src/conf/netdev_bandwidth_c= onf.c index 9af2173b7b..0a27735e71 100644 --- a/src/conf/netdev_bandwidth_conf.c +++ b/src/conf/netdev_bandwidth_conf.c @@ -260,7 +260,7 @@ virNetDevBandwidthRateFormat(virNetDevBandwidthRatePtr = def, * Returns 0 on success, else -1. */ int -virNetDevBandwidthFormat(virNetDevBandwidthPtr def, +virNetDevBandwidthFormat(const virNetDevBandwidth *def, unsigned int class_id, virBufferPtr buf) { diff --git a/src/conf/netdev_bandwidth_conf.h b/src/conf/netdev_bandwidth_c= onf.h index 898b2fb428..0004e48a4a 100644 --- a/src/conf/netdev_bandwidth_conf.h +++ b/src/conf/netdev_bandwidth_conf.h @@ -29,7 +29,7 @@ int virNetDevBandwidthParse(virNetDevBandwidthPtr *bandwi= dth, xmlNodePtr node, bool allowFloor) ATTRIBUTE_NONNULL(1) G_GNUC_WARN_UNUSED_RESULT; -int virNetDevBandwidthFormat(virNetDevBandwidthPtr def, +int virNetDevBandwidthFormat(const virNetDevBandwidth *def, unsigned int class_id, virBufferPtr buf); =20 diff --git a/src/libxl/libxl_conf.c b/src/libxl/libxl_conf.c index 89122826fc..b0d67c7b83 100644 --- a/src/libxl/libxl_conf.c +++ b/src/libxl/libxl_conf.c @@ -1216,7 +1216,7 @@ libxlMakeNic(virDomainDefPtr def, virDomainNetType actual_type =3D virDomainNetGetActualType(l_nic); virNetworkPtr network =3D NULL; virConnectPtr conn =3D NULL; - virNetDevBandwidthPtr actual_bw; + const virNetDevBandwidth *actual_bw; virNetDevVPortProfilePtr port_profile; const virNetDevVlan *virt_vlan; virBuffer buf =3D VIR_BUFFER_INITIALIZER; diff --git a/src/lxc/lxc_driver.c b/src/lxc/lxc_driver.c index 41a6a446bd..34c70240cb 100644 --- a/src/lxc/lxc_driver.c +++ b/src/lxc/lxc_driver.c @@ -3829,7 +3829,7 @@ lxcDomainAttachDeviceNetLive(virConnectPtr conn, virLXCDomainObjPrivatePtr priv =3D vm->privateData; int ret =3D -1; virDomainNetType actualType; - virNetDevBandwidthPtr actualBandwidth; + const virNetDevBandwidth *actualBandwidth; char *veth =3D NULL; =20 if (!priv->initpid) { diff --git a/src/lxc/lxc_process.c b/src/lxc/lxc_process.c index 450053d163..323f3632c0 100644 --- a/src/lxc/lxc_process.c +++ b/src/lxc/lxc_process.c @@ -338,7 +338,7 @@ char *virLXCProcessSetupInterfaceDirect(virConnectPtr c= onn, char *ret =3D NULL; char *res_ifname =3D NULL; virLXCDriverPtr driver =3D conn->privateData; - virNetDevBandwidthPtr bw; + const virNetDevBandwidth *bw; virNetDevVPortProfilePtr prof; virLXCDriverConfigPtr cfg =3D virLXCDriverGetConfig(driver); const char *linkdev =3D virDomainNetGetActualDirectDev(net); @@ -557,7 +557,7 @@ static int virLXCProcessSetupInterfaces(virConnectPtr c= onn, =20 for (i =3D 0; i < def->nnets; i++) { char *veth =3D NULL; - virNetDevBandwidthPtr actualBandwidth; + const virNetDevBandwidth *actualBandwidth; /* If appropriate, grab a physical device from the configured * network's pool of devices, or resolve bridge device name * to the one defined in the network definition. diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c index f24013f9eb..548cba2aec 100644 --- a/src/qemu/qemu_command.c +++ b/src/qemu/qemu_command.c @@ -8397,7 +8397,7 @@ qemuBuildInterfaceCommandLine(virQEMUDriverPtr driver, char **vhostfdName =3D NULL; g_autofree char *slirpfdName =3D NULL; virDomainNetType actualType =3D virDomainNetGetActualType(net); - virNetDevBandwidthPtr actualBandwidth; + const virNetDevBandwidth *actualBandwidth; bool requireNicdev =3D false; qemuSlirpPtr slirp; size_t i; diff --git a/src/qemu/qemu_hotplug.c b/src/qemu/qemu_hotplug.c index 1fa5e6e0f8..4cbe7b0060 100644 --- a/src/qemu/qemu_hotplug.c +++ b/src/qemu/qemu_hotplug.c @@ -1146,7 +1146,7 @@ qemuDomainAttachNetDevice(virQEMUDriverPtr driver, bool releaseaddr =3D false; bool iface_connected =3D false; virDomainNetType actualType; - virNetDevBandwidthPtr actualBandwidth; + const virNetDevBandwidth *actualBandwidth; g_autoptr(virQEMUDriverConfig) cfg =3D virQEMUDriverGetConfig(driver); virDomainCCWAddressSetPtr ccwaddrs =3D NULL; size_t i; @@ -3824,7 +3824,7 @@ qemuDomainChangeNet(virQEMUDriverPtr driver, } =20 if (needBandwidthSet) { - virNetDevBandwidthPtr newb =3D virDomainNetGetActualBandwidth(newd= ev); + const virNetDevBandwidth *newb =3D virDomainNetGetActualBandwidth(= newdev); =20 if (newb) { if (virNetDevBandwidthSet(newdev->ifname, newb, false, diff --git a/src/util/virnetdevbandwidth.c b/src/util/virnetdevbandwidth.c index b90bd55d32..3f3785cb65 100644 --- a/src/util/virnetdevbandwidth.c +++ b/src/util/virnetdevbandwidth.c @@ -190,7 +190,7 @@ virNetDevBandwidthManipulateFilter(const char *ifname, */ int virNetDevBandwidthSet(const char *ifname, - virNetDevBandwidthPtr bandwidth, + const virNetDevBandwidth *bandwidth, bool hierarchical_class, bool swapped) { @@ -485,8 +485,8 @@ virNetDevBandwidthCopy(virNetDevBandwidthPtr *dest, } =20 bool -virNetDevBandwidthEqual(virNetDevBandwidthPtr a, - virNetDevBandwidthPtr b) +virNetDevBandwidthEqual(const virNetDevBandwidth *a, + const virNetDevBandwidth *b) { if (!a && !b) return true; diff --git a/src/util/virnetdevbandwidth.h b/src/util/virnetdevbandwidth.h index 19323c5ed2..871d0c962c 100644 --- a/src/util/virnetdevbandwidth.h +++ b/src/util/virnetdevbandwidth.h @@ -39,7 +39,7 @@ struct _virNetDevBandwidth { void virNetDevBandwidthFree(virNetDevBandwidthPtr def); =20 int virNetDevBandwidthSet(const char *ifname, - virNetDevBandwidthPtr bandwidth, + const virNetDevBandwidth *bandwidth, bool hierarchical_class, bool swapped) G_GNUC_WARN_UNUSED_RESULT; @@ -48,7 +48,7 @@ int virNetDevBandwidthCopy(virNetDevBandwidthPtr *dest, const virNetDevBandwidth *src) ATTRIBUTE_NONNULL(1) G_GNUC_WARN_UNUSED_RESULT; =20 -bool virNetDevBandwidthEqual(virNetDevBandwidthPtr a, virNetDevBandwidthPt= r b); +bool virNetDevBandwidthEqual(const virNetDevBandwidth *a, const virNetDevB= andwidth *b); =20 int virNetDevBandwidthPlug(const char *brname, virNetDevBandwidthPtr net_bandwidth, --=20 2.21.0 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Tue Nov 26 14:41:44 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of redhat.com designates 205.139.110.61 as permitted sender) client-ip=205.139.110.61; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-delivery-1.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zoho.com: domain of redhat.com designates 205.139.110.61 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=1571793978; cv=none; d=zoho.com; s=zohoarc; b=QR62TNTabsy3wRp6RGlF27HxE72mHO4np0M4cf6x3YkL+murAacyzu3VCIAzXDoI4BwwIMDGX3Zp7xF4t9SN3f7lZJ2QJWeZYfjdGhJ7X+fXt03IBSeayJAcWvz6WQ/p4cfMhwidNrAprb2fnN4dKM4fKpR82V8QPfljV/FN7o0= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1571793978; 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=lXj+pr259B1kvu2h70NDyxg8bwpI3yt50v9mons7g7s=; b=hP3FRf3BNlqUpTWguXO/NUkTvrUoZyPMsp8m5ZLo+USSTJNF5fnk0Z79WLfD7ryLmVMYGhg+Ig8VyvY+eSh3Z1MmKMtckFNn6M8DNeJdgyNruiAAMLZIt6IorXEez8Ywqq9ik8ZTfbFuQehA4xsEMa4ARX9nerEIbqq1uyTuYyU= ARC-Authentication-Results: i=1; mx.zoho.com; dkim=pass; spf=pass (zoho.com: domain of redhat.com designates 205.139.110.61 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from us-smtp-delivery-1.mimecast.com (us-smtp-1.mimecast.com [205.139.110.61]) by mx.zohomail.com with SMTPS id 1571793978088608.0005081201919; Tue, 22 Oct 2019 18:26:18 -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-142-xf1ZTGlKPribqdIB91JQrg-1; Tue, 22 Oct 2019 21:26:13 -0400 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id C925B107AD33; Wed, 23 Oct 2019 01:26:07 +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 9BB4C19C70; Wed, 23 Oct 2019 01:26:07 +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 4B90C180B761; Wed, 23 Oct 2019 01:26:07 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id x9N1OTaJ030890 for ; Tue, 22 Oct 2019 21:24:29 -0400 Received: by smtp.corp.redhat.com (Postfix) id 636555D6C8; Wed, 23 Oct 2019 01:24:29 +0000 (UTC) Received: from vhost2.laine.org (ovpn-117-114.phx2.redhat.com [10.3.117.114]) by smtp.corp.redhat.com (Postfix) with ESMTP id 0D2B05D6B2 for ; Wed, 23 Oct 2019 01:24:28 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1571793976; 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=lXj+pr259B1kvu2h70NDyxg8bwpI3yt50v9mons7g7s=; b=VJO3vAt+XXdkxPyK9MwGizq0u6SLkcQcz5ouLYZjW+r8T/P+vEZJ/NA7XeZRG7XaM/b2SG AA/dAVEZiBfrfki1DHBi7k2rx8RPoLbPyVUVRQXWqdenesLk7i/pQM0bd3uplsdrr36Tkn pSloe2KszydHUwrO0973aRGCxjsm8eU= From: Laine Stump To: libvir-list@redhat.com Date: Tue, 22 Oct 2019 21:24:17 -0400 Message-Id: <20191023012420.21128-5-laine@redhat.com> In-Reply-To: <20191023012420.21128-1-laine@redhat.com> References: <20191023012420.21128-1-laine@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH 4/7] conf: return a const from virDomainNetGetActualVirtPortProfile 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.84 on 10.5.11.23 X-MC-Unique: xf1ZTGlKPribqdIB91JQrg-1 X-Mimecast-Spam-Score: 0 Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) Content-Type: text/plain; charset="utf-8" This also isn't required (due to the vportprofile being stored in the NetDef as a pointer rather than being directly contained), but it seemed dishonest to not mark it as const (and thus permit users to modify its contents) Signed-off-by: Laine Stump --- src/conf/domain_conf.c | 2 +- src/conf/domain_conf.h | 2 +- src/conf/netdev_vport_profile_conf.c | 2 +- src/conf/netdev_vport_profile_conf.h | 2 +- src/libxl/libxl_conf.c | 2 +- src/libxl/xen_common.c | 2 +- src/lxc/lxc_driver.c | 2 +- src/lxc/lxc_process.c | 8 ++++---- src/qemu/qemu_domain.c | 2 +- src/qemu/qemu_hotplug.c | 2 +- src/qemu/qemu_migration_cookie.c | 2 +- src/qemu/qemu_process.c | 2 +- src/util/virhostdev.c | 6 +++--- src/util/virnetdevmacvlan.c | 16 ++++++++-------- src/util/virnetdevmacvlan.h | 8 ++++---- src/util/virnetdevmidonet.c | 4 ++-- src/util/virnetdevmidonet.h | 4 ++-- src/util/virnetdevopenvswitch.c | 2 +- src/util/virnetdevopenvswitch.h | 2 +- src/util/virnetdevtap.c | 6 +++--- src/util/virnetdevtap.h | 6 +++--- src/util/virnetdevvportprofile.c | 12 ++++++------ src/util/virnetdevvportprofile.h | 12 ++++++------ tests/bhyvexml2argvmock.c | 2 +- 24 files changed, 55 insertions(+), 55 deletions(-) diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c index 76e036c48e..af8c0af7c7 100644 --- a/src/conf/domain_conf.c +++ b/src/conf/domain_conf.c @@ -29665,7 +29665,7 @@ virDomainNetGetActualHostdev(virDomainNetDefPtr ifa= ce) return NULL; } =20 -virNetDevVPortProfilePtr +const virNetDevVPortProfile * virDomainNetGetActualVirtPortProfile(const virDomainNetDef *iface) { switch (iface->type) { diff --git a/src/conf/domain_conf.h b/src/conf/domain_conf.h index 44d5fb8e16..b08202b092 100644 --- a/src/conf/domain_conf.h +++ b/src/conf/domain_conf.h @@ -3209,7 +3209,7 @@ int virDomainNetGetActualBridgeMACTableManager(virDom= ainNetDefPtr iface); const char *virDomainNetGetActualDirectDev(virDomainNetDefPtr iface); int virDomainNetGetActualDirectMode(virDomainNetDefPtr iface); virDomainHostdevDefPtr virDomainNetGetActualHostdev(virDomainNetDefPtr ifa= ce); -virNetDevVPortProfilePtr +const virNetDevVPortProfile * virDomainNetGetActualVirtPortProfile(const virDomainNetDef *iface); const virNetDevBandwidth * virDomainNetGetActualBandwidth(const virDomainNetDef *iface); diff --git a/src/conf/netdev_vport_profile_conf.c b/src/conf/netdev_vport_p= rofile_conf.c index 660478d128..1dd8439adb 100644 --- a/src/conf/netdev_vport_profile_conf.c +++ b/src/conf/netdev_vport_profile_conf.c @@ -197,7 +197,7 @@ virNetDevVPortProfileParse(xmlNodePtr node, unsigned in= t flags) =20 =20 int -virNetDevVPortProfileFormat(virNetDevVPortProfilePtr virtPort, +virNetDevVPortProfileFormat(const virNetDevVPortProfile *virtPort, virBufferPtr buf) { enum virNetDevVPortProfile type; diff --git a/src/conf/netdev_vport_profile_conf.h b/src/conf/netdev_vport_p= rofile_conf.h index a2989af81e..6a99a42ee8 100644 --- a/src/conf/netdev_vport_profile_conf.h +++ b/src/conf/netdev_vport_profile_conf.h @@ -40,5 +40,5 @@ virNetDevVPortProfilePtr virNetDevVPortProfileParse(xmlNodePtr node, unsigned int flags); =20 int -virNetDevVPortProfileFormat(virNetDevVPortProfilePtr virtPort, +virNetDevVPortProfileFormat(const virNetDevVPortProfile *virtPort, virBufferPtr buf); diff --git a/src/libxl/libxl_conf.c b/src/libxl/libxl_conf.c index b0d67c7b83..113999b7b5 100644 --- a/src/libxl/libxl_conf.c +++ b/src/libxl/libxl_conf.c @@ -1217,7 +1217,7 @@ libxlMakeNic(virDomainDefPtr def, virNetworkPtr network =3D NULL; virConnectPtr conn =3D NULL; const virNetDevBandwidth *actual_bw; - virNetDevVPortProfilePtr port_profile; + const virNetDevVPortProfile *port_profile; const virNetDevVlan *virt_vlan; virBuffer buf =3D VIR_BUFFER_INITIALIZER; size_t i; diff --git a/src/libxl/xen_common.c b/src/libxl/xen_common.c index 6e77921333..140a122fa1 100644 --- a/src/libxl/xen_common.c +++ b/src/libxl/xen_common.c @@ -1680,7 +1680,7 @@ xenFormatNet(virConnectPtr conn, switch (net->type) { case VIR_DOMAIN_NET_TYPE_BRIDGE: { - virNetDevVPortProfilePtr port_profile =3D virDomainNetGetActualVir= tPortProfile(net); + const virNetDevVPortProfile *port_profile =3D virDomainNetGetActua= lVirtPortProfile(net); const virNetDevVlan *virt_vlan =3D virDomainNetGetActualVlan(net); const char *script =3D net->script; size_t i; diff --git a/src/lxc/lxc_driver.c b/src/lxc/lxc_driver.c index 34c70240cb..1a1239b1bd 100644 --- a/src/lxc/lxc_driver.c +++ b/src/lxc/lxc_driver.c @@ -4351,7 +4351,7 @@ lxcDomainDetachDeviceNetLive(virDomainObjPtr vm, int detachidx, ret =3D -1; virDomainNetType actualType; virDomainNetDefPtr detach =3D NULL; - virNetDevVPortProfilePtr vport =3D NULL; + const virNetDevVPortProfile *vport =3D NULL; virErrorPtr save_err =3D NULL; =20 if ((detachidx =3D virDomainNetFindIdx(vm->def, dev->data.net)) < 0) diff --git a/src/lxc/lxc_process.c b/src/lxc/lxc_process.c index 323f3632c0..1a565b6358 100644 --- a/src/lxc/lxc_process.c +++ b/src/lxc/lxc_process.c @@ -163,7 +163,7 @@ static void virLXCProcessCleanup(virLXCDriverPtr driver, { size_t i; virLXCDomainObjPrivatePtr priv =3D vm->privateData; - virNetDevVPortProfilePtr vport =3D NULL; + const virNetDevVPortProfile *vport =3D NULL; virLXCDriverConfigPtr cfg =3D virLXCDriverGetConfig(driver); virConnectPtr conn =3D NULL; =20 @@ -284,7 +284,7 @@ virLXCProcessSetupInterfaceTap(virDomainDefPtr vm, char *ret =3D NULL; char *parentVeth; char *containerVeth =3D NULL; - virNetDevVPortProfilePtr vport =3D virDomainNetGetActualVirtPortProfil= e(net); + const virNetDevVPortProfile *vport =3D virDomainNetGetActualVirtPortPr= ofile(net); =20 VIR_DEBUG("calling vethCreate()"); parentVeth =3D net->ifname; @@ -339,7 +339,7 @@ char *virLXCProcessSetupInterfaceDirect(virConnectPtr c= onn, char *res_ifname =3D NULL; virLXCDriverPtr driver =3D conn->privateData; const virNetDevBandwidth *bw; - virNetDevVPortProfilePtr prof; + const virNetDevVPortProfile *prof; virLXCDriverConfigPtr cfg =3D virLXCDriverGetConfig(driver); const char *linkdev =3D virDomainNetGetActualDirectDev(net); unsigned int macvlan_create_flags =3D VIR_NETDEV_MACVLAN_CREATE_IFUP; @@ -645,7 +645,7 @@ static int virLXCProcessSetupInterfaces(virConnectPtr c= onn, virErrorPreserveLast(&save_err); for (i =3D 0; i < def->nnets; i++) { virDomainNetDefPtr iface =3D def->nets[i]; - virNetDevVPortProfilePtr vport =3D virDomainNetGetActualVirtPo= rtProfile(iface); + const virNetDevVPortProfile *vport =3D virDomainNetGetActualVi= rtPortProfile(iface); if (vport && vport->virtPortType =3D=3D VIR_NETDEV_VPORT_PROFI= LE_OPENVSWITCH) ignore_value(virNetDevOpenvswitchRemovePort( virDomainNetGetActualBridgeName(iface), diff --git a/src/qemu/qemu_domain.c b/src/qemu/qemu_domain.c index b2e8759da7..0181b62602 100644 --- a/src/qemu/qemu_domain.c +++ b/src/qemu/qemu_domain.c @@ -5420,7 +5420,7 @@ qemuDomainValidateActualNetDef(const virDomainNetDef = *net, * a element in the config) */ if (net->filter) { - virNetDevVPortProfilePtr vport =3D virDomainNetGetActualVirtPortPr= ofile(net); + const virNetDevVPortProfile *vport =3D virDomainNetGetActualVirtPo= rtProfile(net); =20 if (!(actualType =3D=3D VIR_DOMAIN_NET_TYPE_NETWORK || actualType =3D=3D VIR_DOMAIN_NET_TYPE_BRIDGE || diff --git a/src/qemu/qemu_hotplug.c b/src/qemu/qemu_hotplug.c index 4cbe7b0060..8c5f516ab2 100644 --- a/src/qemu/qemu_hotplug.c +++ b/src/qemu/qemu_hotplug.c @@ -1108,7 +1108,7 @@ qemuDomainAttachDeviceDiskLive(virQEMUDriverPtr drive= r, static void qemuDomainNetDeviceVportRemove(virDomainNetDefPtr net) { - virNetDevVPortProfilePtr vport =3D virDomainNetGetActualVirtPortProfil= e(net); + const virNetDevVPortProfile *vport =3D virDomainNetGetActualVirtPortPr= ofile(net); const char *brname; =20 if (!vport) diff --git a/src/qemu/qemu_migration_cookie.c b/src/qemu/qemu_migration_coo= kie.c index f625c7086b..a3de9180ea 100644 --- a/src/qemu/qemu_migration_cookie.c +++ b/src/qemu/qemu_migration_cookie.c @@ -243,7 +243,7 @@ qemuMigrationCookieNetworkAlloc(virQEMUDriverPtr driver= G_GNUC_UNUSED, =20 for (i =3D 0; i < def->nnets; i++) { virDomainNetDefPtr netptr; - virNetDevVPortProfilePtr vport; + const virNetDevVPortProfile *vport; =20 netptr =3D def->nets[i]; vport =3D virDomainNetGetActualVirtPortProfile(netptr); diff --git a/src/qemu/qemu_process.c b/src/qemu/qemu_process.c index 7e0dc26658..a387341c8e 100644 --- a/src/qemu/qemu_process.c +++ b/src/qemu/qemu_process.c @@ -7384,7 +7384,7 @@ void qemuProcessStop(virQEMUDriverPtr driver, qemuDomainObjPrivatePtr priv =3D vm->privateData; virErrorPtr orig_err; virDomainDefPtr def; - virNetDevVPortProfilePtr vport =3D NULL; + const virNetDevVPortProfile *vport =3D NULL; size_t i; char *timestamp; virQEMUDriverConfigPtr cfg =3D virQEMUDriverGetConfig(driver); diff --git a/src/util/virhostdev.c b/src/util/virhostdev.c index 223a78bd34..8922a01d4b 100644 --- a/src/util/virhostdev.c +++ b/src/util/virhostdev.c @@ -406,7 +406,7 @@ virHostdevIsVFIODevice(const virDomainHostdevDef *hostd= ev) =20 static int virHostdevNetConfigVirtPortProfile(const char *linkdev, int vf, - virNetDevVPortProfilePtr virtPort, + const virNetDevVPortProfile *virtPort, const virMacAddr *macaddr, const unsigned char *uuid, bool associate) @@ -502,7 +502,7 @@ virHostdevSetNetConfig(virDomainHostdevDefPtr hostdev, { g_autofree char *linkdev =3D NULL; const virNetDevVlan *vlan; - virNetDevVPortProfilePtr virtPort; + const virNetDevVPortProfile *virtPort; int vf =3D -1; bool port_profile_associate =3D true; =20 @@ -552,7 +552,7 @@ virHostdevRestoreNetConfig(virDomainHostdevDefPtr hostd= ev, g_autofree virMacAddrPtr MAC =3D NULL; g_autofree virMacAddrPtr adminMAC =3D NULL; g_autoptr(virNetDevVlan) vlan =3D NULL; - virNetDevVPortProfilePtr virtPort; + const virNetDevVPortProfile *virtPort; int vf =3D -1; bool port_profile_associate =3D false; =20 diff --git a/src/util/virnetdevmacvlan.c b/src/util/virnetdevmacvlan.c index c530cb75ed..e343dad923 100644 --- a/src/util/virnetdevmacvlan.c +++ b/src/util/virnetdevmacvlan.c @@ -828,7 +828,7 @@ virNetDevMacVLanVPortProfileRegisterCallback(const char= *ifname, const virMacAddr *macaddress, const char *linkdev, const unsigned char *vmuuid, - virNetDevVPortProfilePtr virt= PortProfile, + const virNetDevVPortProfile *= virtPortProfile, virNetDevVPortProfileOp vmOp) { virNetlinkCallbackDataPtr calld =3D NULL; @@ -897,7 +897,7 @@ virNetDevMacVLanCreateWithVPortProfile(const char *ifna= meRequested, virNetDevMacVLanMode mode, const virNetDevVlan *vlan, const unsigned char *vmuuid, - virNetDevVPortProfilePtr virtPortPr= ofile, + const virNetDevVPortProfile *virtPo= rtProfile, char **ifnameResult, virNetDevVPortProfileOp vmOp, char *stateDir, @@ -1094,7 +1094,7 @@ int virNetDevMacVLanDeleteWithVPortProfile(const char= *ifname, const virMacAddr *macaddr, const char *linkdev, int mode, - virNetDevVPortProfilePtr virtPo= rtProfile, + const virNetDevVPortProfile *vi= rtPortProfile, char *stateDir) { int ret =3D 0; @@ -1149,7 +1149,7 @@ int virNetDevMacVLanRestartWithVPortProfile(const cha= r *cr_ifname, const virMacAddr *macaddress, const char *linkdev, const unsigned char *vmuuid, - virNetDevVPortProfilePtr virtP= ortProfile, + const virNetDevVPortProfile *v= irtPortProfile, virNetDevVPortProfileOp vmOp) { int rc =3D 0; @@ -1226,7 +1226,7 @@ int virNetDevMacVLanCreateWithVPortProfile(const char= *ifname G_GNUC_UNUSED, virNetDevMacVLanMode mode G_GNU= C_UNUSED, const virNetDevVlan *vlan G_GNU= C_UNUSED, const unsigned char *vmuuid G_G= NUC_UNUSED, - virNetDevVPortProfilePtr virtPo= rtProfile G_GNUC_UNUSED, + const virNetDevVPortProfile *vi= rtPortProfile G_GNUC_UNUSED, char **res_ifname G_GNUC_UNUSED, virNetDevVPortProfileOp vmop G_= GNUC_UNUSED, char *stateDir G_GNUC_UNUSED, @@ -1243,7 +1243,7 @@ int virNetDevMacVLanDeleteWithVPortProfile(const char= *ifname G_GNUC_UNUSED, const virMacAddr *macaddress G_= GNUC_UNUSED, const char *linkdev G_GNUC_UNUS= ED, int mode G_GNUC_UNUSED, - virNetDevVPortProfilePtr virtPo= rtProfile G_GNUC_UNUSED, + const virNetDevVPortProfile *vi= rtPortProfile G_GNUC_UNUSED, char *stateDir G_GNUC_UNUSED) { virReportSystemError(ENOSYS, "%s", @@ -1255,7 +1255,7 @@ int virNetDevMacVLanRestartWithVPortProfile(const cha= r *cr_ifname G_GNUC_UNUSED, const virMacAddr *macaddress G= _GNUC_UNUSED, const char *linkdev G_GNUC_UNU= SED, const unsigned char *vmuuid G_= GNUC_UNUSED, - virNetDevVPortProfilePtr virtP= ortProfile G_GNUC_UNUSED, + const virNetDevVPortProfile *v= irtPortProfile G_GNUC_UNUSED, virNetDevVPortProfileOp vmOp G= _GNUC_UNUSED) { virReportSystemError(ENOSYS, "%s", @@ -1267,7 +1267,7 @@ int virNetDevMacVLanVPortProfileRegisterCallback(cons= t char *ifname G_GNUC_UNUSE const virMacAddr *macaddr= ess G_GNUC_UNUSED, const char *linkdev G_GNU= C_UNUSED, const unsigned char *vmuu= id G_GNUC_UNUSED, - virNetDevVPortProfilePtr = virtPortProfile G_GNUC_UNUSED, + const virNetDevVPortProfi= le *virtPortProfile G_GNUC_UNUSED, virNetDevVPortProfileOp v= mOp G_GNUC_UNUSED) { virReportSystemError(ENOSYS, "%s", diff --git a/src/util/virnetdevmacvlan.h b/src/util/virnetdevmacvlan.h index f455ec3384..fc1bb018a2 100644 --- a/src/util/virnetdevmacvlan.h +++ b/src/util/virnetdevmacvlan.h @@ -78,7 +78,7 @@ int virNetDevMacVLanCreateWithVPortProfile(const char *if= name, virNetDevMacVLanMode mode, const virNetDevVlan *vlan, const unsigned char *vmuuid, - virNetDevVPortProfilePtr virtPo= rtProfile, + const virNetDevVPortProfile *vi= rtPortProfile, char **res_ifname, virNetDevVPortProfileOp vmop, char *stateDir, @@ -101,7 +101,7 @@ int virNetDevMacVLanDeleteWithVPortProfile(const char *= ifname, const virMacAddr *macaddress, const char *linkdev, int mode, - virNetDevVPortProfilePtr virtPo= rtProfile, + const virNetDevVPortProfile *vi= rtPortProfile, char *stateDir) ATTRIBUTE_NONNULL(2) ATTRIBUTE_NONNULL(3) ATTRIBUTE_NONNULL(6) G_GNUC_WARN_UNUSED_RESULT; @@ -110,7 +110,7 @@ int virNetDevMacVLanRestartWithVPortProfile(const char = *cr_ifname, const virMacAddr *macaddress, const char *linkdev, const unsigned char *vmuuid, - virNetDevVPortProfilePtr virtP= ortProfile, + const virNetDevVPortProfile *v= irtPortProfile, virNetDevVPortProfileOp vmOp) ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2) ATTRIBUTE_NONNULL(3) ATTRIBUTE_NONNULL(4) G_GNUC_WARN_UNUSED_RESULT; @@ -119,7 +119,7 @@ int virNetDevMacVLanVPortProfileRegisterCallback(const = char *ifname, const virMacAddr *macaddr= ess, const char *linkdev, const unsigned char *vmuu= id, - virNetDevVPortProfilePtr = virtPortProfile, + const virNetDevVPortProfi= le *virtPortProfile, virNetDevVPortProfileOp v= mOp) ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2) ATTRIBUTE_NONNULL(3) ATTRIBUTE_NONNULL(4) G_GNUC_WARN_UNUSED_RESULT; diff --git a/src/util/virnetdevmidonet.c b/src/util/virnetdevmidonet.c index e50cceaef5..354350ce1b 100644 --- a/src/util/virnetdevmidonet.c +++ b/src/util/virnetdevmidonet.c @@ -37,7 +37,7 @@ */ int virNetDevMidonetBindPort(const char *ifname, - virNetDevVPortProfilePtr virtualport) + const virNetDevVPortProfile *virtualport) { int ret =3D -1; virCommandPtr cmd =3D NULL; @@ -71,7 +71,7 @@ virNetDevMidonetBindPort(const char *ifname, * Returns 0 in case of success or -1 in case of failure. */ int -virNetDevMidonetUnbindPort(virNetDevVPortProfilePtr virtualport) +virNetDevMidonetUnbindPort(const virNetDevVPortProfile *virtualport) { int ret =3D -1; virCommandPtr cmd =3D NULL; diff --git a/src/util/virnetdevmidonet.h b/src/util/virnetdevmidonet.h index 61927c3edd..87ac3d74a1 100644 --- a/src/util/virnetdevmidonet.h +++ b/src/util/virnetdevmidonet.h @@ -23,8 +23,8 @@ =20 =20 int virNetDevMidonetBindPort(const char *ifname, - virNetDevVPortProfilePtr virtualport) + const virNetDevVPortProfile *virtualport) ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2) G_GNUC_WARN_UNUSED_RESULT; =20 -int virNetDevMidonetUnbindPort(virNetDevVPortProfilePtr virtualport) +int virNetDevMidonetUnbindPort(const virNetDevVPortProfile *virtualport) ATTRIBUTE_NONNULL(1) G_GNUC_WARN_UNUSED_RESULT; diff --git a/src/util/virnetdevopenvswitch.c b/src/util/virnetdevopenvswitc= h.c index 9aa2c5ad84..81898057b1 100644 --- a/src/util/virnetdevopenvswitch.c +++ b/src/util/virnetdevopenvswitch.c @@ -135,7 +135,7 @@ virNetDevOpenvswitchConstructVlans(virCommandPtr cmd, c= onst virNetDevVlan *virtV int virNetDevOpenvswitchAddPort(const char *brname, const char *ifname, const virMacAddr *macaddr, const unsigned char *vmuuid, - virNetDevVPortProfilePtr ovsport, + const virNetDevVPortProfile *ovsport, const virNetDevVlan *virtVlan) { char macaddrstr[VIR_MAC_STRING_BUFLEN]; diff --git a/src/util/virnetdevopenvswitch.h b/src/util/virnetdevopenvswitc= h.h index dddb21a5a2..c9ea592058 100644 --- a/src/util/virnetdevopenvswitch.h +++ b/src/util/virnetdevopenvswitch.h @@ -32,7 +32,7 @@ int virNetDevOpenvswitchAddPort(const char *brname, const char *ifname, const virMacAddr *macaddr, const unsigned char *vmuuid, - virNetDevVPortProfilePtr ovsport, + const virNetDevVPortProfile *ovsport, const virNetDevVlan *virtVlan) ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2) ATTRIBUTE_NONNULL(3) G_GNUC_WARN_UNUSED_RESULT; diff --git a/src/util/virnetdevtap.c b/src/util/virnetdevtap.c index fa1626d6ba..d012c5e210 100644 --- a/src/util/virnetdevtap.c +++ b/src/util/virnetdevtap.c @@ -502,7 +502,7 @@ virNetDevTapAttachBridge(const char *tapname, const char *brname, const virMacAddr *macaddr, const unsigned char *vmuuid, - virNetDevVPortProfilePtr virtPortProfile, + const virNetDevVPortProfile *virtPortProfile, const virNetDevVlan *virtVlan, unsigned int mtu, unsigned int *actualMTU) @@ -574,7 +574,7 @@ virNetDevTapReattachBridge(const char *tapname, const char *brname, const virMacAddr *macaddr, const unsigned char *vmuuid, - virNetDevVPortProfilePtr virtPortProfile, + const virNetDevVPortProfile *virtPortProfile, const virNetDevVlan *virtVlan, unsigned int mtu, unsigned int *actualMTU) @@ -660,7 +660,7 @@ int virNetDevTapCreateInBridgePort(const char *brname, const char *tunpath, int *tapfd, size_t tapfdSize, - virNetDevVPortProfilePtr virtPortProfil= e, + const virNetDevVPortProfile *virtPortPr= ofile, const virNetDevVlan *virtVlan, virNetDevCoalescePtr coalesce, unsigned int mtu, diff --git a/src/util/virnetdevtap.h b/src/util/virnetdevtap.h index 4fc734fd5e..cae8e61861 100644 --- a/src/util/virnetdevtap.h +++ b/src/util/virnetdevtap.h @@ -63,7 +63,7 @@ virNetDevTapAttachBridge(const char *tapname, const char *brname, const virMacAddr *macaddr, const unsigned char *vmuuid, - virNetDevVPortProfilePtr virtPortProfile, + const virNetDevVPortProfile *virtPortProfile, const virNetDevVlan *virtVlan, unsigned int mtu, unsigned int *actualMTU) @@ -75,7 +75,7 @@ virNetDevTapReattachBridge(const char *tapname, const char *brname, const virMacAddr *macaddr, const unsigned char *vmuuid, - virNetDevVPortProfilePtr virtPortProfile, + const virNetDevVPortProfile *virtPortProfile, const virNetDevVlan *virtVlan, unsigned int mtu, unsigned int *actualMTU) @@ -89,7 +89,7 @@ int virNetDevTapCreateInBridgePort(const char *brname, const char *tunpath, int *tapfd, size_t tapfdSize, - virNetDevVPortProfilePtr virtPortProfil= e, + const virNetDevVPortProfile *virtPortPr= ofile, const virNetDevVlan *virtVlan, virNetDevCoalescePtr coalesce, unsigned int mtu, diff --git a/src/util/virnetdevvportprofile.c b/src/util/virnetdevvportprof= ile.c index 6442c2a2cf..593bd6e2d6 100644 --- a/src/util/virnetdevvportprofile.c +++ b/src/util/virnetdevvportprofile.c @@ -85,7 +85,7 @@ enum virNetDevVPortProfileLinkOp { #endif =20 bool -virNetDevVPortProfileEqual(virNetDevVPortProfilePtr a, virNetDevVPortProfi= lePtr b) +virNetDevVPortProfileEqual(const virNetDevVPortProfile *a, const virNetDev= VPortProfile *b) { /* NULL resistant */ if (!a && !b) @@ -226,7 +226,7 @@ virNetDevVPortProfileCheckComplete(virNetDevVPortProfil= ePtr virtport, * an error is logged and -1 is returned. */ int -virNetDevVPortProfileCheckNoExtras(virNetDevVPortProfilePtr virtport) +virNetDevVPortProfileCheckNoExtras(const virNetDevVPortProfile *virtport) { const char *extra =3D NULL; =20 @@ -283,7 +283,7 @@ virNetDevVPortProfileCheckNoExtras(virNetDevVPortProfil= ePtr virtport) */ static int virNetDevVPortProfileMerge(virNetDevVPortProfilePtr orig, - virNetDevVPortProfilePtr mods) + const virNetDevVPortProfile *mods) { enum virNetDevVPortProfile otype; =20 @@ -423,9 +423,9 @@ virNetDevVPortProfileMerge(virNetDevVPortProfilePtr ori= g, */ =20 int virNetDevVPortProfileMerge3(virNetDevVPortProfilePtr *result, - virNetDevVPortProfilePtr fromInterface, - virNetDevVPortProfilePtr fromNetwork, - virNetDevVPortProfilePtr fromPortgroup) + const virNetDevVPortProfile *fromInterface, + const virNetDevVPortProfile *fromNetwork, + const virNetDevVPortProfile *fromPortgroup) { int ret =3D -1; *result =3D NULL; diff --git a/src/util/virnetdevvportprofile.h b/src/util/virnetdevvportprof= ile.h index 5fdd019a09..88a42a1816 100644 --- a/src/util/virnetdevvportprofile.h +++ b/src/util/virnetdevvportprofile.h @@ -77,19 +77,19 @@ struct _virNetDevVPortProfile { }; =20 =20 -bool virNetDevVPortProfileEqual(virNetDevVPortProfilePtr a, - virNetDevVPortProfilePtr b); +bool virNetDevVPortProfileEqual(const virNetDevVPortProfile *a, + const virNetDevVPortProfile *b); int virNetDevVPortProfileCopy(virNetDevVPortProfilePtr *dst, const virNetDevVPortProfile *src); =20 int virNetDevVPortProfileCheckComplete(virNetDevVPortProfilePtr virtport, bool generateMissing); -int virNetDevVPortProfileCheckNoExtras(virNetDevVPortProfilePtr virtport); +int virNetDevVPortProfileCheckNoExtras(const virNetDevVPortProfile *virtpo= rt); =20 int virNetDevVPortProfileMerge3(virNetDevVPortProfilePtr *result, - virNetDevVPortProfilePtr fromInterface, - virNetDevVPortProfilePtr fromNetwork, - virNetDevVPortProfilePtr fromPortgroup); + const virNetDevVPortProfile *fromInterface, + const virNetDevVPortProfile *fromNetwork, + const virNetDevVPortProfile *fromPortgroup= ); =20 int virNetDevVPortProfileAssociate(const char *ifname, const virNetDevVPortProfile *virtPort, diff --git a/tests/bhyvexml2argvmock.c b/tests/bhyvexml2argvmock.c index ac4ffe8596..2a552f9f47 100644 --- a/tests/bhyvexml2argvmock.c +++ b/tests/bhyvexml2argvmock.c @@ -26,7 +26,7 @@ int virNetDevTapCreateInBridgePort(const char *brname G_G= NUC_UNUSED, const char *tunpath G_GNUC_UNUSED, int *tapfd G_GNUC_UNUSED, size_t tapfdSize G_GNUC_UNUSED, - virNetDevVPortProfilePtr virtPortProfil= e G_GNUC_UNUSED, + const virNetDevVPortProfile *virtPortPr= ofile G_GNUC_UNUSED, const virNetDevVlan *virtVlan G_GNUC_UN= USED, virNetDevCoalescePtr coalesce G_GNUC_UN= USED, unsigned int mtu G_GNUC_UNUSED, --=20 2.21.0 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Tue Nov 26 14:41:44 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of redhat.com designates 207.211.31.81 as permitted sender) client-ip=207.211.31.81; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-delivery-1.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zoho.com: domain of redhat.com designates 207.211.31.81 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=1571794092; cv=none; d=zoho.com; s=zohoarc; b=Mx11VCRmMpYHdjt1PGL77y42bpa9rrvM6NJ18sn68rpxoQWFgxAFudF1sdiGy5DsTYl1EdrgdPhvuXHR4Gj015vymfk97/+3Wo+GGaVez7XpANhOER14wu9E464umYSNz+wZ1kNJfKmcdjyLGBPfmAJhpt7fukcgDwTo9lXUVE8= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1571794092; 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=f2fpOxgZejewNT+X0RhSrtxOLoHkrRhWcesM5dc905s=; b=cQGsTKyeLTdOm/+HOxVzK17opkKKu1Ya0A1BFQsn1N7D5/DIBWxAZ5Au3MAgZk6/smxNkrdJDaqMdwiaKhYcyCkm2iw2jNItqm9wp8B10rXAA1DRmvQIojEl9tqpfkXVrKf6xy7ZN8FF1yYvikuHUy6c8Cz9m6XB2hwxJGYIYbc= ARC-Authentication-Results: i=1; mx.zoho.com; dkim=pass; spf=pass (zoho.com: domain of redhat.com designates 207.211.31.81 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from us-smtp-delivery-1.mimecast.com (us-smtp-2.mimecast.com [207.211.31.81]) by mx.zohomail.com with SMTPS id 1571794092123266.1692873774035; Tue, 22 Oct 2019 18:28:12 -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-13-8cQNWz1aPlytpXtV6jWuOg-1; Tue, 22 Oct 2019 21:26:16 -0400 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 222A0107AD37; Wed, 23 Oct 2019 01:26:12 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.21]) by smtp.corp.redhat.com (Postfix) with ESMTPS id E1A6E4128; Wed, 23 Oct 2019 01:26:11 +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 86BDE4E58B; Wed, 23 Oct 2019 01:26:11 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id x9N1OTPu030895 for ; Tue, 22 Oct 2019 21:24:29 -0400 Received: by smtp.corp.redhat.com (Postfix) id CED345D6C8; Wed, 23 Oct 2019 01:24:29 +0000 (UTC) Received: from vhost2.laine.org (ovpn-117-114.phx2.redhat.com [10.3.117.114]) by smtp.corp.redhat.com (Postfix) with ESMTP id 8CAAB5D6B2 for ; Wed, 23 Oct 2019 01:24:29 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1571794091; 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=f2fpOxgZejewNT+X0RhSrtxOLoHkrRhWcesM5dc905s=; b=ETjN1A3Nk6qqAvEcyqfgE1Q6WkpzZ3pJmqZtbXFMIKEqVST6tOvt5vxOnTBD1HAaqYcIkZ ueOQgd2BlvbYWEHFeX0OJPGgDagJktxb3m4pKqdoIHcm9dYuaKSUo2axWSKqfcqwWn5o6Y M9ErRUtzfSvYdPICBx4n72Hbi/uVbug= From: Laine Stump To: libvir-list@redhat.com Date: Tue, 22 Oct 2019 21:24:18 -0400 Message-Id: <20191023012420.21128-6-laine@redhat.com> In-Reply-To: <20191023012420.21128-1-laine@redhat.com> References: <20191023012420.21128-1-laine@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH 5/7] conf: change args/return values of remaining virDomainNetGetActual*() to const 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.84 on 10.5.11.23 X-MC-Unique: 8cQNWz1aPlytpXtV6jWuOg-1 X-Mimecast-Spam-Score: 0 Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) Content-Type: text/plain; charset="utf-8" These all just return a scalar value, so there's no daisy-chained fallout from changing them, and they can easily be combined in a single patch. Signed-off-by: Laine Stump --- src/conf/domain_conf.c | 10 +++++----- src/conf/domain_conf.h | 10 +++++----- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c index af8c0af7c7..01a1a74946 100644 --- a/src/conf/domain_conf.c +++ b/src/conf/domain_conf.c @@ -29606,7 +29606,7 @@ virDomainNetGetActualType(const virDomainNetDef *if= ace) } =20 const char * -virDomainNetGetActualBridgeName(virDomainNetDefPtr iface) +virDomainNetGetActualBridgeName(const virDomainNetDef *iface) { if (iface->type =3D=3D VIR_DOMAIN_NET_TYPE_BRIDGE) return iface->data.bridge.brname; @@ -29619,7 +29619,7 @@ virDomainNetGetActualBridgeName(virDomainNetDefPtr = iface) } =20 int -virDomainNetGetActualBridgeMACTableManager(virDomainNetDefPtr iface) +virDomainNetGetActualBridgeMACTableManager(const virDomainNetDef *iface) { if (iface->type =3D=3D VIR_DOMAIN_NET_TYPE_NETWORK && iface->data.network.actual && @@ -29630,7 +29630,7 @@ virDomainNetGetActualBridgeMACTableManager(virDomai= nNetDefPtr iface) } =20 const char * -virDomainNetGetActualDirectDev(virDomainNetDefPtr iface) +virDomainNetGetActualDirectDev(const virDomainNetDef *iface) { if (iface->type =3D=3D VIR_DOMAIN_NET_TYPE_DIRECT) return iface->data.direct.linkdev; @@ -29642,7 +29642,7 @@ virDomainNetGetActualDirectDev(virDomainNetDefPtr i= face) } =20 int -virDomainNetGetActualDirectMode(virDomainNetDefPtr iface) +virDomainNetGetActualDirectMode(const virDomainNetDef *iface) { if (iface->type =3D=3D VIR_DOMAIN_NET_TYPE_DIRECT) return iface->data.direct.mode; @@ -29729,7 +29729,7 @@ virDomainNetGetActualVlan(const virDomainNetDef *if= ace) =20 =20 bool -virDomainNetGetActualTrustGuestRxFilters(virDomainNetDefPtr iface) +virDomainNetGetActualTrustGuestRxFilters(const virDomainNetDef *iface) { if (iface->type =3D=3D VIR_DOMAIN_NET_TYPE_NETWORK && iface->data.network.actual) diff --git a/src/conf/domain_conf.h b/src/conf/domain_conf.h index b08202b092..4a7010e8a5 100644 --- a/src/conf/domain_conf.h +++ b/src/conf/domain_conf.h @@ -3204,17 +3204,17 @@ int virDomainGraphicsListenAppendSocket(virDomainGr= aphicsDefPtr def, ATTRIBUTE_NONNULL(1); =20 virDomainNetType virDomainNetGetActualType(const virDomainNetDef *iface); -const char *virDomainNetGetActualBridgeName(virDomainNetDefPtr iface); -int virDomainNetGetActualBridgeMACTableManager(virDomainNetDefPtr iface); -const char *virDomainNetGetActualDirectDev(virDomainNetDefPtr iface); -int virDomainNetGetActualDirectMode(virDomainNetDefPtr iface); +const char *virDomainNetGetActualBridgeName(const virDomainNetDef *iface); +int virDomainNetGetActualBridgeMACTableManager(const virDomainNetDef *ifac= e); +const char *virDomainNetGetActualDirectDev(const virDomainNetDef *iface); +int virDomainNetGetActualDirectMode(const virDomainNetDef *iface); virDomainHostdevDefPtr virDomainNetGetActualHostdev(virDomainNetDefPtr ifa= ce); const virNetDevVPortProfile * virDomainNetGetActualVirtPortProfile(const virDomainNetDef *iface); const virNetDevBandwidth * virDomainNetGetActualBandwidth(const virDomainNetDef *iface); const virNetDevVlan *virDomainNetGetActualVlan(const virDomainNetDef *ifac= e); -bool virDomainNetGetActualTrustGuestRxFilters(virDomainNetDefPtr iface); +bool virDomainNetGetActualTrustGuestRxFilters(const virDomainNetDef *iface= ); const char *virDomainNetGetModelString(const virDomainNetDef *net); int virDomainNetSetModelString(virDomainNetDefPtr et, const char *model); --=20 2.21.0 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Tue Nov 26 14:41:44 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of redhat.com designates 207.211.31.120 as permitted sender) client-ip=207.211.31.120; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-1.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zoho.com: domain of redhat.com designates 207.211.31.120 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=1571793959; cv=none; d=zoho.com; s=zohoarc; b=U2FBvhA18CcGElS6eOOAaGJV0jVbzmWHGqN/5qPFWbSJCuKXcnNwMWsaY2UmGvuOlfB6y7Fflb68AkdsaA7h28ZwEtFVs/PkHrEi5r8xlq2mD+QLDlyT+wRKN4QsEqCunqn6ddWv/TvccfO2jp6aEojZHDGZVuGi9pykx1AadJk= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1571793959; 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=4J1RdsEhKXb1no2RwjYJXsk00v0cPtk1+0gwf60QRfE=; b=P7V6fs2fU8KNU5axissX++3e+PrWXaGud6cABiBLylETL1LXTY5joI9W+Avp9lVxR804/mEgxGzhcGVc+x0DVqx5HBt2H2TA/8W7vDvFDBGhZBQgvYkPjEPJ7950ukqzYEeL8U5O/eo9vA4qtwSxbf4sm36r1/M3i1dGkAYtcbk= ARC-Authentication-Results: i=1; mx.zoho.com; dkim=pass; spf=pass (zoho.com: domain of redhat.com designates 207.211.31.120 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from us-smtp-1.mimecast.com (us-smtp-delivery-1.mimecast.com [207.211.31.120]) by mx.zohomail.com with SMTPS id 1571793959781600.1507407391448; Tue, 22 Oct 2019 18:25:59 -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-125-9Dh1vOwvOROZ1beBiIIVcA-1; Tue, 22 Oct 2019 21:25:56 -0400 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 95ADE476; Wed, 23 Oct 2019 01:25:51 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.21]) by smtp.corp.redhat.com (Postfix) with ESMTPS id AB63060C4E; Wed, 23 Oct 2019 01:25:48 +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 A30504A486; Wed, 23 Oct 2019 01:25:44 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id x9N1OUUS030905 for ; Tue, 22 Oct 2019 21:24:30 -0400 Received: by smtp.corp.redhat.com (Postfix) id 4874C5D6C8; Wed, 23 Oct 2019 01:24:30 +0000 (UTC) Received: from vhost2.laine.org (ovpn-117-114.phx2.redhat.com [10.3.117.114]) by smtp.corp.redhat.com (Postfix) with ESMTP id 051BA5D6B2 for ; Wed, 23 Oct 2019 01:24:29 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1571793958; 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=4J1RdsEhKXb1no2RwjYJXsk00v0cPtk1+0gwf60QRfE=; b=RbNwpwNY7CC7mn1XyWUdxV5tnP8oKPkDgoGTs8kqmpU+xu3bmD2BAJFQplcPG+3aB2QsLk 58lh2QH2MPIa6ciOzsV4gXq+IJQz8sDtlWTvoZCkR9dmeIYjcoszSTjaWMM13CBvLo//AZ q0PFUuZ4zxw9V8j8+SocgNrBB8Loe6M= From: Laine Stump To: libvir-list@redhat.com Date: Tue, 22 Oct 2019 21:24:19 -0400 Message-Id: <20191023012420.21128-7-laine@redhat.com> In-Reply-To: <20191023012420.21128-1-laine@redhat.com> References: <20191023012420.21128-1-laine@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH 6/7] conf: add hypervisor agnostic, domain start-time, validation function for NetDef 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.12 X-MC-Unique: 9Dh1vOwvOROZ1beBiIIVcA-1 X-Mimecast-Spam-Score: 0 Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) Content-Type: text/plain; charset="utf-8" devices (virDomainNetDef) are a bit different from other types of devices in that their actual type may come from a network (in the form of a port connection), and that doesn't happen until the domain is started. This means that any validation of an at parse time needs to be a bit liberal in what it accepts - when type=3D'network', you could think that something is/isn't allowed, but once the domain is started and a port is created by the configured network, the opposite might be true. To solve this problem hypervisor drivers need to do an extra validation step when the domain is being started. I recently (commit 3cff23f7, libvirt 5.7.0) added a function to peform such validation for all interfaces to the QEMU driver - qemuDomainValidateActualNetDef() - but while that function is a good single point to call for the multiple places that need to "start" an interface (domain startup, device hotplug, device update), it can't be called by the other hypervisor drivers, since 1) it's in the QEMU driver, and 2) it contains some checks specific to QEMU. For validation that applies to network devices on *all* hypervisors, we need yet another interface validation function that can be called by any hypervisor driver (not just QEMU) right after its network port has been created during domain startup or hotplug. This patch adds that function - virDomainNetDefRuntimeValidate(), in the conf directory, and calls it in appropriate places in the QEMU, lxc, and libxl drivers. The new function, virDomainNetDefRuntimeValidate(), should contain network device validation that 1) is hypervisor agnostic, and 2) can't be done until we know the "actual type" of an interface. There is no framework for validation at domain startup as there is for post-parse validation, but I don't want to create a whole elaborate system that will only be used by one type of device. For that reason, I just made a single function that should be called directly from the hypervisors, when they are initializing interfaces to start a domain, right after conditionally allocating the network port (and regardless of whether or not that was actually needed). In the case of the QEMU driver, qemuDomainValidateActualNetDef() is already called in all the appropriate places, so we can just call the new function from there. In the case of the other hypervisors, we search for virDomainNetAllocateActualDevice() (which is the hypervisor-agnostic function that calls virNetworkPortCreateXML()), and add the call to our new function right after that. The new function itself could be plunked down into many places in the code, but we already have 3 validation functions for network devices in 2 different places (not counting any basic validation done in virDomainNetDefParseXML() itself): 1) post-parse hypervisor-agnostic (virDomainNetDefValidate() - domain_conf.c:6145) 2) post-parse hypervisor-specific (qemuDomainDeviceDefValidateNetwork() - qemu_domain.c:5498) 3) domain-start hypervisor-specific (qemuDomainValidateActualNetDef() - qemu_domain.c:5390) I placed (3) right next to (2) when I added it, specifically to avoid spreading validation all over the code. For the same reason, I decided to put this new function right next to (1) - this way if someone needs to add validation specific to qemu, they go to one location, and if they need to add validation applying to everyone, they go to the other. It looks a bit strange to have a public function in between a bunch of statics, but I think it's better than the alternative of further fragmentation. (I'm open to other ideas though, of course.) Signed-off-by: Laine Stump Reviewed-by: Cole Robinson --- src/conf/domain_conf.c | 22 ++++++++++++++++++++++ src/conf/domain_conf.h | 3 +++ src/libvirt_private.syms | 1 + src/libxl/libxl_domain.c | 4 ++++ src/libxl/libxl_driver.c | 4 ++++ src/lxc/lxc_driver.c | 4 ++++ src/lxc/lxc_process.c | 4 ++++ src/qemu/qemu_domain.c | 6 ++++++ 8 files changed, 48 insertions(+) diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c index 01a1a74946..c063f40a4c 100644 --- a/src/conf/domain_conf.c +++ b/src/conf/domain_conf.c @@ -6094,6 +6094,28 @@ virDomainRedirdevDefValidate(const virDomainDef *def, } =20 =20 +int +virDomainNetDefRuntimeValidate(const virDomainNetDef *net G_GNUC_UNUSED) +{ + /* Unlike virDomainNetDefValidate(), which is a static function + * called internally to this file, virDomainActualNetDefValidate() + * is a public function that can be called from a hypervisor after + * it has completely setup the NetDef for use by a domain, + * including possibly allocating a port from the network driver + * (which could change the effective/"actual" type of the NetDef, + * thus changing what should/shouldn't be allowed by validation). + * + * This function should contain validations not specific to a + * particular hypervisor (e.g. whether or not specifying bandwidth + * is allowed for a type of interface), but *not* + * hypervisor-specific things. + */ + + return 0; + +} + + static int virDomainNetDefValidate(const virDomainNetDef *net) { diff --git a/src/conf/domain_conf.h b/src/conf/domain_conf.h index 4a7010e8a5..dc0226e6da 100644 --- a/src/conf/domain_conf.h +++ b/src/conf/domain_conf.h @@ -2802,6 +2802,9 @@ int virDomainDefValidate(virDomainDefPtr def, unsigned int parseFlags, virDomainXMLOptionPtr xmlopt); =20 +int +virDomainNetDefRuntimeValidate(const virDomainNetDef *net); + static inline bool virDomainObjIsActive(virDomainObjPtr dom) { diff --git a/src/libvirt_private.syms b/src/libvirt_private.syms index 12cb3b5bf7..811d01c4f5 100644 --- a/src/libvirt_private.syms +++ b/src/libvirt_private.syms @@ -479,6 +479,7 @@ virDomainNetDefClear; virDomainNetDefFormat; virDomainNetDefFree; virDomainNetDefNew; +virDomainNetDefRuntimeValidate; virDomainNetDefToNetworkPort; virDomainNetFind; virDomainNetFindByName; diff --git a/src/libxl/libxl_domain.c b/src/libxl/libxl_domain.c index d79c3c1ed7..57d2a4aeb5 100644 --- a/src/libxl/libxl_domain.c +++ b/src/libxl/libxl_domain.c @@ -1065,6 +1065,10 @@ libxlNetworkPrepareDevices(virDomainDefPtr def) goto cleanup; } =20 + /* final validation now that actual type is known */ + if (virDomainNetDefRuntimeValidate(net) < 0) + return -1; + actualType =3D virDomainNetGetActualType(net); if (actualType =3D=3D VIR_DOMAIN_NET_TYPE_HOSTDEV && net->type =3D=3D VIR_DOMAIN_NET_TYPE_NETWORK) { diff --git a/src/libxl/libxl_driver.c b/src/libxl/libxl_driver.c index 5cc6b87b8c..323cb92c04 100644 --- a/src/libxl/libxl_driver.c +++ b/src/libxl/libxl_driver.c @@ -3425,6 +3425,10 @@ libxlDomainAttachNetDevice(libxlDriverPrivatePtr dri= ver, goto cleanup; } =20 + /* final validation now that actual type is known */ + if (virDomainNetDefRuntimeValidate(net) < 0) + return -1; + actualType =3D virDomainNetGetActualType(net); =20 if (virDomainHasNet(vm->def, net)) { diff --git a/src/lxc/lxc_driver.c b/src/lxc/lxc_driver.c index 1a1239b1bd..8d519d282a 100644 --- a/src/lxc/lxc_driver.c +++ b/src/lxc/lxc_driver.c @@ -3860,6 +3860,10 @@ lxcDomainAttachDeviceNetLive(virConnectPtr conn, virObjectUnref(netconn); } =20 + /* final validation now that actual type is known */ + if (virDomainNetDefRuntimeValidate(net) < 0) + return -1; + actualType =3D virDomainNetGetActualType(net); =20 switch (actualType) { diff --git a/src/lxc/lxc_process.c b/src/lxc/lxc_process.c index 1a565b6358..13547abec4 100644 --- a/src/lxc/lxc_process.c +++ b/src/lxc/lxc_process.c @@ -574,6 +574,10 @@ static int virLXCProcessSetupInterfaces(virConnectPtr = conn, goto cleanup; } =20 + /* final validation now that actual type is known */ + if (virDomainNetDefRuntimeValidate(net) < 0) + return -1; + type =3D virDomainNetGetActualType(net); switch (type) { case VIR_DOMAIN_NET_TYPE_NETWORK: diff --git a/src/qemu/qemu_domain.c b/src/qemu/qemu_domain.c index 0181b62602..a8a7907546 100644 --- a/src/qemu/qemu_domain.c +++ b/src/qemu/qemu_domain.c @@ -5389,6 +5389,12 @@ qemuDomainValidateActualNetDef(const virDomainNetDef= *net, =20 virMacAddrFormat(&net->mac, macstr); =20 + /* hypervisor-agnostic validation */ + if (virDomainNetDefRuntimeValidate(net) < 0) + return -1; + + /* QEMU-specific validation */ + /* Only tap/macvtap devices support multiqueue. */ if (net->driver.virtio.queues > 0) { =20 --=20 2.21.0 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Tue Nov 26 14:41:44 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of redhat.com designates 205.139.110.61 as permitted sender) client-ip=205.139.110.61; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-delivery-1.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zoho.com: domain of redhat.com designates 205.139.110.61 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=1571793975; cv=none; d=zoho.com; s=zohoarc; b=mlNhQysBzNKGSuBrS49JwcAaSfRdkPNJnxscZELtCY6geqfwAAHrcUmjdC7eqmL4zHM2MA+I41sDx7r6RRrgVszR6ge5etLj/SaQPnVUD3g4MHTJj/A+TmAbhUglBsPEpcxlsFMUUN/feU82nct/kpXPBI6QoE+6c630OwJCJbc= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1571793975; 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=hQy0/WNTbTgPOKEU+NRi2YbBaNCdutaFlmCEFrhJ6Go=; b=OgpDPGAA3soPdEFZiDyblSqm5TKGj2WpcAxVGtcrxZbob0Pw1ZCojaHFKr2fvEA58TvwgWeHf3w0SoKOZGiB8q9zCq8PUTa08treXeD5KBhttmE8fSTWzt5Cf5eWCFmhfgXV5/MYD35qi5LkjNd1HfJyju9O8+8mmM86qQQhz9E= ARC-Authentication-Results: i=1; mx.zoho.com; dkim=pass; spf=pass (zoho.com: domain of redhat.com designates 205.139.110.61 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from us-smtp-delivery-1.mimecast.com (us-smtp-1.mimecast.com [205.139.110.61]) by mx.zohomail.com with SMTPS id 1571793975147251.59030588934274; Tue, 22 Oct 2019 18:26:15 -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-314-72Y4enPfMmSYlBB4gzQh_A-1; Tue, 22 Oct 2019 21:26:12 -0400 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id D951B801E52; Wed, 23 Oct 2019 01:26:07 +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 B024D60619; Wed, 23 Oct 2019 01:26:07 +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 43F541803B49; Wed, 23 Oct 2019 01:26:07 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id x9N1OUCg030910 for ; Tue, 22 Oct 2019 21:24:30 -0400 Received: by smtp.corp.redhat.com (Postfix) id B4B8E5D6C8; Wed, 23 Oct 2019 01:24:30 +0000 (UTC) Received: from vhost2.laine.org (ovpn-117-114.phx2.redhat.com [10.3.117.114]) by smtp.corp.redhat.com (Postfix) with ESMTP id 721DF5D6B2 for ; Wed, 23 Oct 2019 01:24:30 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1571793974; 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=hQy0/WNTbTgPOKEU+NRi2YbBaNCdutaFlmCEFrhJ6Go=; b=TgPSq6ra/55CKebKKX0DhBj8oyOHXy1bH3S7NtMGg2m9xKvWy+/oKQcyE1ZJ+JUI2asLIF ENWsS3ktRB5R+3TYvj/pgNgxg5ooLOPAlANO7VpL8j4XOUwpLN+5GY0u5U9oDasdVoWtKx 2g7qzuGPVqD4zjCwbMS5xroK/DxFdNg= From: Laine Stump To: libvir-list@redhat.com Date: Tue, 22 Oct 2019 21:24:20 -0400 Message-Id: <20191023012420.21128-8-laine@redhat.com> In-Reply-To: <20191023012420.21128-1-laine@redhat.com> References: <20191023012420.21128-1-laine@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH 7/7] net/qemu: move vlan/bandwidth validation out of network driver 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.13 X-MC-Unique: 72Y4enPfMmSYlBB4gzQh_A-1 X-Mimecast-Spam-Score: 0 Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) Content-Type: text/plain; charset="utf-8" In the past the network driver was (mistakenly) being called for all interfaces, not just those of type=3D'network', and so it had a chance to validate all interface configs after the actual type of the interface was known. But since the network driver has been more completely/properly separated from qemu, the network driver isn't called during the startup of any interfaces except those with type=3D'network', so this validation no longer takes place for, e.g. (or direct, etc). This in turn meant that a config could erroneously specify a vlan tag, or bandwidth settings, for a type of interface that didn't support it, and the domain would start without complaint, just silently ignoring those settings. This patch moves those validation checks out of the network driver, and into virDomainNetDefRuntimeValidate() so they will be done for all interfaces, not just type=3D'network'. https://bugzilla.redhat.com/1741121 Signed-off-by: Laine Stump --- src/conf/domain_conf.c | 36 +++++++++++++++++++++++++++++++++++- src/network/bridge_driver.c | 37 ------------------------------------- 2 files changed, 35 insertions(+), 38 deletions(-) diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c index c063f40a4c..59a75e67ed 100644 --- a/src/conf/domain_conf.c +++ b/src/conf/domain_conf.c @@ -6110,9 +6110,43 @@ virDomainNetDefRuntimeValidate(const virDomainNetDef= *net G_GNUC_UNUSED) * is allowed for a type of interface), but *not* * hypervisor-specific things. */ + char macstr[VIR_MAC_STRING_BUFLEN]; + virDomainNetType actualType =3D virDomainNetGetActualType(net); + const virNetDevVPortProfile *vport =3D virDomainNetGetActualVirtPortPr= ofile(net); + const virNetDevBandwidth *bandwidth =3D virDomainNetGetActualBandwidth= (net); =20 - return 0; + virMacAddrFormat(&net->mac, macstr); =20 + if (virDomainNetGetActualVlan(net)) { + /* vlan configuration via libvirt is only supported for PCI + * Passthrough SR-IOV devices (hostdev or macvtap passthru + * mode) and openvswitch bridges. Otherwise log an error and + * fail + */ + if (!(actualType =3D=3D VIR_DOMAIN_NET_TYPE_HOSTDEV || + (actualType =3D=3D VIR_DOMAIN_NET_TYPE_DIRECT && + virDomainNetGetActualDirectMode(net) =3D=3D VIR_NETDEV_MACV= LAN_MODE_PASSTHRU) || + (actualType =3D=3D VIR_DOMAIN_NET_TYPE_BRIDGE && + vport && vport->virtPortType =3D=3D VIR_NETDEV_VPORT_PROFI= LE_OPENVSWITCH))) { + virReportError(VIR_ERR_CONFIG_UNSUPPORTED, + _("interface %s - vlan tag not supported for th= is connection type"), + macstr); + return -1; + } + } + + /* bandwidth configuration via libvirt is not supported for + * hostdev network devices + */ + if (bandwidth && actualType =3D=3D VIR_DOMAIN_NET_TYPE_HOSTDEV) { + virReportError(VIR_ERR_CONFIG_UNSUPPORTED, + _("interface %s - bandwidth settings are not suppor= ted " + "for hostdev interfaces"), + macstr); + return -1; + } + + return 0; } =20 =20 diff --git a/src/network/bridge_driver.c b/src/network/bridge_driver.c index 85e568e888..1c47485b9d 100644 --- a/src/network/bridge_driver.c +++ b/src/network/bridge_driver.c @@ -4793,43 +4793,6 @@ networkAllocatePort(virNetworkObjPtr obj, if (virNetDevVPortProfileCheckComplete(port->virtPortProfile, true) < = 0) goto cleanup; =20 - /* make sure that everything now specified for the device is - * actually supported on this type of network. NB: network, - * netdev, and iface->data.network.actual may all be NULL. - */ - VIR_DEBUG("Sanity check port config"); - - if (port->vlan.nTags) { - /* vlan configuration via libvirt is only supported for PCI - * Passthrough SR-IOV devices (hostdev or macvtap passthru - * mode) and openvswitch bridges. Otherwise log an error and - * fail - */ - if (!(port->plugtype =3D=3D VIR_NETWORK_PORT_PLUG_TYPE_HOSTDEV_PCI= || - (port->plugtype =3D=3D VIR_NETWORK_PORT_PLUG_TYPE_DIRECT && - port->plug.direct.mode =3D=3D VIR_NETDEV_MACVLAN_MODE_PASST= HRU) || - (port->plugtype =3D=3D VIR_NETWORK_PORT_PLUG_TYPE_BRIDGE && - port->virtPortProfile && - port->virtPortProfile->virtPortType =3D=3D VIR_NETDEV_VPORT= _PROFILE_OPENVSWITCH))) { - virReportError(VIR_ERR_CONFIG_UNSUPPORTED, - _("an interface connecting to network '%s' " - "is requesting a vlan tag, but that is not " - "supported for this type of network"), - netdef->name); - goto cleanup; - } - } - - /* bandwidth configuration via libvirt is not supported for - * hostdev network devices - */ - if (port->bandwidth && port->plugtype =3D=3D VIR_NETWORK_PORT_PLUG_TYP= E_HOSTDEV_PCI) { - virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s", - _("bandwidth settings are not supported " - "for hostdev interfaces")); - goto cleanup; - } - netdef->connections++; if (dev) dev->connections++; --=20 2.21.0 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list