From nobody Fri Apr 19 14:30:22 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.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 (zohomail.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 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 1581076463289615.6533334968008; Fri, 7 Feb 2020 03:54:23 -0800 (PST) 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-191-_fb6X9IpPY6qwQkzgxLHyQ-1; Fri, 07 Feb 2020 06:54:20 -0500 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 F28F8DB60; Fri, 7 Feb 2020 11:54:14 +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 F06251001B07; Fri, 7 Feb 2020 11:54:13 +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 1909B866BB; Fri, 7 Feb 2020 11:54:12 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 017BsBY5031637 for ; Fri, 7 Feb 2020 06:54:11 -0500 Received: by smtp.corp.redhat.com (Postfix) id 4BA625C541; Fri, 7 Feb 2020 11:54:11 +0000 (UTC) Received: from lpt.redhat.com (ovpn-200-40.brq.redhat.com [10.40.200.40]) by smtp.corp.redhat.com (Postfix) with ESMTP id 1F2665C3FD for ; Fri, 7 Feb 2020 11:54:09 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1581076462; 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=0eNF5Toj96cK6TduhWArXA+KDm+YK5JZb0FRO+hiONE=; b=T4xGLdUFDEazBRU3AZES2aEoGiOHqd8rMbTV39Xi0JK3YYyOAAS9zImTujIpFilEWDAgHi 6EO3Nt+C0jngnZp8QFjR4Y04QrSO3risOOyjHn55YytSA/7FkI6O0ao1UWLPfreaaX22/K RM/JG54jmvlhFBk8oYXR1ZX5PvLOHHo= From: =?UTF-8?q?J=C3=A1n=20Tomko?= To: libvir-list@redhat.com Subject: [libvirt PATCH 1/2] qemu: do not revert to NULL bandwidth Date: Fri, 7 Feb 2020 12:54:00 +0100 Message-Id: In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 X-loop: libvir-list@redhat.com 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: _fb6X9IpPY6qwQkzgxLHyQ-1 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) Content-Type: text/plain; charset="utf-8" Otherwise an attempt to set an invalid value: virsh domiftune rhel8.2 vnet0 --outbound 4294968 on an interface with no bandwidth set crashes. Signed-off-by: J=C3=A1n Tomko Fixes: f02e21cb3379a41cd42f2d8116f2d10dabace83b https://bugzilla.redhat.com/show_bug.cgi?id=3D1800505 Reviewed-by: Daniel Henrique Barboza --- src/qemu/qemu_driver.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c index 502f4ce342..0324c771a5 100644 --- a/src/qemu/qemu_driver.c +++ b/src/qemu/qemu_driver.c @@ -11665,8 +11665,10 @@ qemuDomainSetInterfaceParameters(virDomainPtr dom, net->bandwidth, false, !virDomainNetTypeSharesHost= View(net))); - ignore_value(virDomainNetBandwidthUpdate(net, - net->bandwidth)); + if (net->bandwidth) { + ignore_value(virDomainNetBandwidthUpdate(net, + net->bandwidth)); + } goto endjob; } =20 --=20 2.21.1 From nobody Fri Apr 19 14:30:22 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.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 (zohomail.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 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 1581076480927714.7132604938992; Fri, 7 Feb 2020 03:54:40 -0800 (PST) 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-197-gE7v5AllOyy4J7UjyN70Tw-1; Fri, 07 Feb 2020 06:54:37 -0500 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 3C8C81052BA7; Fri, 7 Feb 2020 11:54:32 +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 1441E60BEC; Fri, 7 Feb 2020 11:54:32 +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 C0F92866BC; Fri, 7 Feb 2020 11:54:31 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 017BsCd1031647 for ; Fri, 7 Feb 2020 06:54:12 -0500 Received: by smtp.corp.redhat.com (Postfix) id 533AB5C541; Fri, 7 Feb 2020 11:54:12 +0000 (UTC) Received: from lpt.redhat.com (ovpn-200-40.brq.redhat.com [10.40.200.40]) by smtp.corp.redhat.com (Postfix) with ESMTP id BCBC85C3FD for ; Fri, 7 Feb 2020 11:54:11 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1581076479; 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=v1dVG0895XIKfwePctopvHnOV84B9A5H2MrFOsrBKgY=; b=bNCqMunazfeWX02oCM6kKWx+KfPdXMG1EG/2hUF7iaSYGg05lrv2/gqcg4QMl2Zgpm74qR gH8zGpwRmdpZb/uctkNRxVIE/rPhzq+7rVyw8yLJ3/HDDAUIqFr9cNpZVe5LuM9a7a0ayL VChqbt0T4IVdO5cIZ51ADVIAFPCnBRQ= From: =?UTF-8?q?J=C3=A1n=20Tomko?= To: libvir-list@redhat.com Subject: [libvirt PATCH 2/2] qemu: preserve error on bandwidth rollback Date: Fri, 7 Feb 2020 12:54:01 +0100 Message-Id: <5273bf4b7cbff7c56152ba7f62b7880ce9771125.1581076405.git.jtomko@redhat.com> In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 X-loop: libvir-list@redhat.com 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: gE7v5AllOyy4J7UjyN70Tw-1 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) Content-Type: text/plain; charset="utf-8" We call APIs that reset the error in the rollback code. Preserve the error from the original call that failed. This turns the boringly cryptic: error: Unable to set interface parameters error: An error occurred, but the cause is unknown to the unexpectedly anarchist: error: internal error: Child process (/usr/sbin/tc filter add dev vnet1 parent ffff: protocol all u32 match u32 0 0 police rate 4294968kbps burst 4294968kb mtu 64kb drop flowid :1) unexpected exit status 1: Illegal "rate" Illegal "police" Signed-off-by: J=C3=A1n Tomko Fixes: f02e21cb3379a41cd42f2d8116f2d10dabace83b https://bugzilla.redhat.com/show_bug.cgi?id=3D1800505 Reviewed-by: Daniel Henrique Barboza --- src/qemu/qemu_driver.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c index 0324c771a5..ad5c7d9ff1 100644 --- a/src/qemu/qemu_driver.c +++ b/src/qemu/qemu_driver.c @@ -11661,6 +11661,9 @@ qemuDomainSetInterfaceParameters(virDomainPtr dom, =20 if (virNetDevBandwidthSet(net->ifname, newBandwidth, false, !virDomainNetTypeSharesHostView(net)) < = 0) { + virErrorPtr orig_err; + + virErrorPreserveLast(&orig_err); ignore_value(virNetDevBandwidthSet(net->ifname, net->bandwidth, false, @@ -11669,6 +11672,7 @@ qemuDomainSetInterfaceParameters(virDomainPtr dom, ignore_value(virDomainNetBandwidthUpdate(net, net->bandwidth)); } + virErrorRestore(&orig_err); goto endjob; } =20 --=20 2.21.1