From nobody Mon Feb 9 00:54:20 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) client-ip=209.132.183.28; envelope-from=libvir-list-bounces@redhat.com; helo=mx1.redhat.com; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.28 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=1568386368; cv=none; d=zoho.com; s=zohoarc; b=Kh9FulH+mRHpFDkehhiGkMUo4drnXlfX2qEQ0woP14p47/l6yBNU/LdP9CnrRvb2tvmu74XeiROYcRqLIzDv0H52MKfTITsRDDbC3zozPg0Q1hVsStwYKhNU3FfPC39PO081oetHkTU+mavoeWfcbqcMM/Wc3R32ZZ31cm4JHx4= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1568386368; 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:ARC-Authentication-Results; bh=wBFVYBIFqt1gDq5YbjXTzv2m8xi9bePugwC44lCbSjg=; b=F57hD1ECKqKBi6j3nei2SdjjaCS/KVhAZxWnP6WvO43DirCkmjFRhOjrqzfpm/QeyGT2NtXQHgwoqk3A4Ujf3OnO2H+PCmW4J8EWGElfqKRxpyCxyX7SHseVn9OwWcNe4MYR+XTZhXDqrYPnUglAZiSKmcgL5ZaEc4UhuPjcS30= ARC-Authentication-Results: i=1; mx.zoho.com; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 1568386368090945.8785181045855; Fri, 13 Sep 2019 07:52:48 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id C6EEC8980FB; Fri, 13 Sep 2019 14:52:45 +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 A17BA518EA; Fri, 13 Sep 2019 14:52:45 +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 5E3C9180B536; Fri, 13 Sep 2019 14:52:45 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id x8DEqdJt003087 for ; Fri, 13 Sep 2019 10:52:39 -0400 Received: by smtp.corp.redhat.com (Postfix) id E26BD5D9CD; Fri, 13 Sep 2019 14:52:39 +0000 (UTC) Received: from vhost2.laine.org (ovpn-118-98.phx2.redhat.com [10.3.118.98]) by smtp.corp.redhat.com (Postfix) with ESMTP id A246B5D9E1 for ; Fri, 13 Sep 2019 14:52:39 +0000 (UTC) From: Laine Stump To: libvir-list@redhat.com Date: Fri, 13 Sep 2019 10:52:31 -0400 Message-Id: <20190913145231.774-4-laine@redhat.com> In-Reply-To: <20190913145231.774-1-laine@redhat.com> References: <20190913145231.774-1-laine@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH 3/3] qemu: call common NetDef validation for hotplug and device update 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: , Content-Transfer-Encoding: quoted-printable Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.6.2 (mx1.redhat.com [10.5.110.67]); Fri, 13 Sep 2019 14:52:46 +0000 (UTC) Content-Type: text/plain; charset="utf-8" qemuDomainAttachNetDevice() (hotplug) previously had some of the validation that is in qemuDomainValidateActualNetDef(), but it was incomplete. qemuDomainChangeNet() had none of that validation, but it is all appropriate in both cases. This is the final piece of a previously partial resolution to https://bugzilla.redhat.com/1502754 Signed-off-by: Laine Stump --- src/qemu/qemu_hotplug.c | 32 ++++++++------------------------ 1 file changed, 8 insertions(+), 24 deletions(-) diff --git a/src/qemu/qemu_hotplug.c b/src/qemu/qemu_hotplug.c index bd8868b0f7..0530bdd990 100644 --- a/src/qemu/qemu_hotplug.c +++ b/src/qemu/qemu_hotplug.c @@ -1188,32 +1188,11 @@ qemuDomainAttachNetDevice(virQEMUDriverPtr driver, goto cleanup; } =20 - actualType =3D virDomainNetGetActualType(net); - - /* Currently only TAP/macvtap devices supports multiqueue. */ - if (net->driver.virtio.queues > 0 && - !(actualType =3D=3D VIR_DOMAIN_NET_TYPE_NETWORK || - actualType =3D=3D VIR_DOMAIN_NET_TYPE_BRIDGE || - actualType =3D=3D VIR_DOMAIN_NET_TYPE_DIRECT || - 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)); + /* final validation now that we have full info on the type */ + if (qemuDomainValidateActualNetDef(net, priv->qemuCaps) < 0) return -1; - } =20 - /* and only TAP devices support nwfilter rules */ - if (net->filter && - !(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 " - "network interfaces of type %s"), - virDomainNetTypeToString(actualType)); - return -1; - } + actualType =3D virDomainNetGetActualType(net); =20 if (qemuAssignDeviceNetAlias(vm->def, net, -1) < 0) goto cleanup; @@ -3542,6 +3521,7 @@ qemuDomainChangeNet(virQEMUDriverPtr driver, virDomainObjPtr vm, virDomainDeviceDefPtr dev) { + qemuDomainObjPrivatePtr priv =3D vm->privateData; virDomainNetDefPtr newdev =3D dev->data.net; virDomainNetDefPtr *devslot =3D NULL; virDomainNetDefPtr olddev; @@ -3749,6 +3729,10 @@ qemuDomainChangeNet(virQEMUDriverPtr driver, goto cleanup; } =20 + /* final validation now that we have full info on the type */ + if (qemuDomainValidateActualNetDef(newdev, priv->qemuCaps) < 0) + goto cleanup; + newType =3D virDomainNetGetActualType(newdev); =20 if (newType =3D=3D VIR_DOMAIN_NET_TYPE_HOSTDEV) { --=20 2.21.0 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list