From nobody Fri Oct 18 06:14:06 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 1717063221198250.45809103826014; Thu, 30 May 2024 03:00:21 -0700 (PDT) Received: by lists.libvirt.org (Postfix, from userid 996) id EABA11A81; Thu, 30 May 2024 06:00:19 -0400 (EDT) Received: from lists.libvirt.org (localhost [IPv6:::1]) by lists.libvirt.org (Postfix) with ESMTP id 4DEE319A5; Thu, 30 May 2024 05:59:46 -0400 (EDT) Received: by lists.libvirt.org (Postfix, from userid 996) id 727E11995; Thu, 30 May 2024 05:59:42 -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 A7E96190C for ; Thu, 30 May 2024 05:59:40 -0400 (EDT) Received: from mimecast-mx02.redhat.com (mx-ext.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-404-KFCyQxLvP-evxvAMFowH5g-1; Thu, 30 May 2024 05:59:38 -0400 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.rdu2.redhat.com [10.11.54.6]) (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 mimecast-mx02.redhat.com (Postfix) with ESMTPS id 70DE51C05122 for ; Thu, 30 May 2024 09:59:38 +0000 (UTC) Received: from maggie.brq.redhat.com (unknown [10.43.3.102]) by smtp.corp.redhat.com (Postfix) with ESMTP id 1B85F200B4D7 for ; Thu, 30 May 2024 09:59:37 +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.6 required=5.0 tests=DKIM_INVALID,DKIM_SIGNED, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H4,RCVD_IN_MSPIKE_WL,SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE 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=1717063180; 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=hRwUpAMwRMk829GYMFZeI9lAT8z6mPvl/Ep25+nJOj8=; b=ZCGwwtzwUc9tRGmyXaqwDcX1GdRgtMFgB2WGa5BSxDhNhtoN9maDkGB52TImYn0nY7h7wP UWi/N7LoMlcT2FO88jBrUj59F25kBJZUUDLhSJp+VGQQPGQvRltgWAKpbYyxXjR+IhaOaA POvvZnpL87nT/QcLeDgIgTN2uYW5yzo= X-MC-Unique: KFCyQxLvP-evxvAMFowH5g-1 From: Michal Privoznik To: devel@lists.libvirt.org Subject: [PATCH] qemu_hotplug: Clear QoS if required in qemuDomainChangeNet() Date: Thu, 30 May 2024 11:59:36 +0200 Message-ID: <35c6d54bf9aa6ea3e2c16900ff035d777e284276.1717063176.git.mprivozn@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.4.1 on 10.11.54.6 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable Message-ID-Hash: 7XYD7X7OHOGXW7RJN6ZFTKSUX6Y3K47G X-Message-ID-Hash: 7XYD7X7OHOGXW7RJN6ZFTKSUX6Y3K47G X-MailFrom: mprivozn@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: 1717063223518100001 Content-Type: text/plain; charset="utf-8"; x-default="true" In one of my recent commits, I've introduced virDomainInterfaceClearQoS() which is a helper that either calls virNetDevBandwidthClear() ('tc' implementation) or virNetDevOpenvswitchInterfaceClearQos() (for ovs ifaces). But I made a micro optimization which leads to a bug: the function checks whether passed iface has any QoS set and returns early if it has none. In majority of cases this is right thing to do, but when removing QoS on virDomainUpdateDeviceFlags() this is problematic. The new definition (passed as argument to virDomainInterfaceClearQoS()) contains no QoS (because user requested its removal) and thus instead of removing the old QoS setting nothing is done. Fortunately, the fix is simple - pass olddev which contains the old QoS setting. Fixes: 812a146dfe784315edece43d09f8d9e432f8230e Signed-off-by: Michal Privoznik Reviewed-by: Jiri Denemark --- src/qemu/qemu_hotplug.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/qemu/qemu_hotplug.c b/src/qemu/qemu_hotplug.c index 4739beead8..c98b0b5d52 100644 --- a/src/qemu/qemu_hotplug.c +++ b/src/qemu/qemu_hotplug.c @@ -4071,7 +4071,7 @@ qemuDomainChangeNet(virQEMUDriver *driver, goto cleanup; } } else { - if (virDomainInterfaceClearQoS(vm->def, newdev) < 0) + if (virDomainInterfaceClearQoS(vm->def, olddev) < 0) goto cleanup; } =20 --=20 2.44.1