From nobody Sat Dec 21 12:18:54 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of lists.libvirt.org designates 8.43.85.245 as permitted sender) client-ip=8.43.85.245; envelope-from=devel-bounces@lists.libvirt.org; helo=lists.libvirt.org; Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of lists.libvirt.org designates 8.43.85.245 as permitted sender) smtp.mailfrom=devel-bounces@lists.libvirt.org; dmarc=fail(p=none dis=none) header.from=redhat.com Return-Path: Received: from lists.libvirt.org (lists.libvirt.org [8.43.85.245]) by mx.zohomail.com with SMTPS id 1727710293160117.1631895193309; Mon, 30 Sep 2024 08:31:33 -0700 (PDT) Received: by lists.libvirt.org (Postfix, from userid 996) id 02F061486; Mon, 30 Sep 2024 11:31:31 -0400 (EDT) Received: from lists.libvirt.org (localhost [IPv6:::1]) by lists.libvirt.org (Postfix) with ESMTP id 4BDCA1243; Mon, 30 Sep 2024 11:31:11 -0400 (EDT) Received: by lists.libvirt.org (Postfix, from userid 996) id C29E611F2; Mon, 30 Sep 2024 11:31:07 -0400 (EDT) Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by lists.libvirt.org (Postfix) with ESMTPS id 65D3511B3 for ; Mon, 30 Sep 2024 11:31:03 -0400 (EDT) Received: from mx-prod-mc-02.mail-002.prod.us-west-2.aws.redhat.com (ec2-54-186-198-63.us-west-2.compute.amazonaws.com [54.186.198.63]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-104-xClLRl0XMneHptI2xY6UPw-1; Mon, 30 Sep 2024 11:31:01 -0400 Received: from mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com (unknown [10.30.177.4]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-02.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 7F03519626F1 for ; Mon, 30 Sep 2024 15:31:00 +0000 (UTC) Received: from vhost3.router.laine.org (unknown [10.22.9.224]) by mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id D649D3023800 for ; Mon, 30 Sep 2024 15:30:38 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on lists.libvirt.org X-Spam-Level: X-Spam-Status: No, score=-0.5 required=5.0 tests=DKIM_INVALID,DKIM_SIGNED, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL,RCVD_IN_VALIDITY_RPBL_BLOCKED, RCVD_IN_VALIDITY_SAFE_BLOCKED,SPF_HELO_NONE autolearn=unavailable autolearn_force=no version=3.4.4 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1727710263; h=from:from: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; bh=uoWsmlQdRd0oEh86Z7VMR2tjh+o2MFeqP+p8LQ/SrZc=; b=GXphbrNIGroPkk3/EATUUqnh2cW7t5m350ei98ygRjlBH6F1iEIwCqnBoK42nDSysCFp6s 7InKN1M2gSu/z84/NLPsMqHH0NURbMZdi3xaXs6XxsAqksg/o1q4itfUBPxcXzB1sC6RZU Nh06t7cI8NYCmfIbjCQRIbIAk8pgl6w= X-MC-Unique: xClLRl0XMneHptI2xY6UPw-1 From: Laine Stump To: devel@lists.libvirt.org Subject: [PATCH] (for 10.8.0? undecided) qemu: fix regression in update-device for interfaces Date: Mon, 30 Sep 2024 11:30:38 -0400 Message-ID: <20240930153038.544124-1-laine@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.4.1 on 10.30.177.4 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable Message-ID-Hash: TD7GEPFKCQKLU3ZIF56WHHVQ5HDWJGSY X-Message-ID-Hash: TD7GEPFKCQKLU3ZIF56WHHVQ5HDWJGSY X-MailFrom: laine@redhat.com X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; header-match-config-1; header-match-config-2; header-match-config-3; header-match-devel.lists.libvirt.org-0; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; suspicious-header X-Mailman-Version: 3.2.2 Precedence: list List-Id: Development discussions about the libvirt library & tools Archived-At: List-Archive: List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZM-MESSAGEID: 1727710294623116600 Content-Type: text/plain; charset="utf-8"; x-default="true" Commit a37bd2a15b8f2e7aa09519c86fe1ba1e59ce113f eliminated a failure to update *any* change in an interface that was connected via a network that consisted of a pool of VFs using macvtap passthrough mode. Unfortunately it caused a regression that results in failure to update changes to bandwidth/vlan/trustGuestRxFilters in any interface connected via a network that uses a bridge to connect tap devices. This fixes that problem by narrowing the usage of the fix in the earlier patch to only be done in the case that the the interface is connected via a macvtap+passthrough network. Signed-off-by: Laine Stump Fixes: a37bd2a15b8f2e7aa09519c86fe1ba1e59ce113f Reviewed-by: Martin Kletzander --- The alternatives to this are: 1) revert a37bd2a15b8f2e7aa09519c86fe1ba1e59ce113f (but I haven't checked yet if that will cause problems with the other patches in that same series) to eliminate the regression but also unfix the bug that was fixed, or 2) Do nothing and release with the regression. Wish I'd found this a couple days earlier :-/ src/qemu/qemu_hotplug.c | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/src/qemu/qemu_hotplug.c b/src/qemu/qemu_hotplug.c index 09a37caf85..4d4bcde1bc 100644 --- a/src/qemu/qemu_hotplug.c +++ b/src/qemu/qemu_hotplug.c @@ -3918,12 +3918,19 @@ qemuDomainChangeNet(virQEMUDriver *driver, * free it if we fail for any reason */ if (newdev->type =3D=3D VIR_DOMAIN_NET_TYPE_NETWORK) { - if (olddev->type =3D=3D VIR_DOMAIN_NET_TYPE_NETWORK - && STREQ(olddev->data.network.name, newdev->data.network.name)= ) { + if (olddev->type =3D=3D VIR_DOMAIN_NET_TYPE_NETWORK && + oldType =3D=3D VIR_DOMAIN_NET_TYPE_DIRECT && + virDomainNetGetActualDirectMode(olddev) =3D=3D VIR_NETDEV_MACV= LAN_MODE_PASSTHRU && + STREQ(olddev->data.network.name, newdev->data.network.name)) { /* old and new are type=3D'network', and the network name - * hasn't changed. In this case we *don't* want to get a - * new port ("actual device") from the network because we - * can use the old one (since it hasn't changed). + * hasn't changed *and* this is a network where each + * connection is allocated exclusive use of a VF + * device. In this case we *don't* want to get a new port + * ("actual device") from the network because attempting + * to allocate a new device would also allocate a + * new/different VF, causing the update to fail. And + * anyway we can use olddev's actualNetDef (since it + * hasn't changed). * * So instead we just duplicate *the pointer to* the * actualNetDef from olddev to newdev so that comparisons --=20 2.46.1