From nobody Mon Feb 9 13:57:51 2026 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 1581697605379150.8645060526834; Fri, 14 Feb 2020 08:26:45 -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-247-YfyOV-ImO5CWkjDS9WVDzQ-1; Fri, 14 Feb 2020 11:26:42 -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 792A88010E3; Fri, 14 Feb 2020 16:26:36 +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 50CAE60BF1; Fri, 14 Feb 2020 16:26:36 +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 09C2A18089CF; Fri, 14 Feb 2020 16:26:36 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 01EGQWig028524 for ; Fri, 14 Feb 2020 11:26:32 -0500 Received: by smtp.corp.redhat.com (Postfix) id BA8141001B34; Fri, 14 Feb 2020 16:26:32 +0000 (UTC) Received: from localhost.localdomain.com (unknown [10.43.2.22]) by smtp.corp.redhat.com (Postfix) with ESMTP id 1424C1001B28; Fri, 14 Feb 2020 16:26:31 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1581697604; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc: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=4dPtO/Idw5QM/7pvy9I29OcrCOhS/wgOHBFJYJvn+mw=; b=KCRqJefX+ViG2JXuygijQcJUUz3RREWovjF4s8FVjZqsh25Wn+/qwanzn7QCAaSTZeGoER QRm+UAQkLRqS8U3L0k8vuHOKgcScYfkdXlxSMpbjnk1/CZQ42wCpygWWuoSMXnER121PNY Sa9KhlTM70uL9TlT3FLBrOJUZyX5iPU= From: Pavel Mores To: libvir-list@redhat.com Subject: [libvirt PATCH v2 3/6] qemu: fail on attempt to set 'floor' if interface type is not 'network' Date: Fri, 14 Feb 2020 17:26:21 +0100 Message-Id: <20200214162624.147825-4-pmores@redhat.com> In-Reply-To: <20200214162624.147825-1-pmores@redhat.com> References: <20200214162624.147825-1-pmores@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.22 X-loop: libvir-list@redhat.com Cc: Pavel Mores 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: YfyOV-ImO5CWkjDS9WVDzQ-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" QoS 'floor' setting is documented to be only supported for interfaces of type 'network'. Fail with an error message on attempt to set 'floor' on an interface of any other type. Signed-off-by: Pavel Mores --- src/qemu/qemu_driver.c | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c index 2813f084cd..f686b858cf 100644 --- a/src/qemu/qemu_driver.c +++ b/src/qemu/qemu_driver.c @@ -11672,9 +11672,21 @@ qemuDomainSetInterfaceParameters(virDomainPtr dom, sizeof(*newBandwidth->out)); } =20 - if (net->type =3D=3D VIR_DOMAIN_NET_TYPE_NETWORK && - virDomainNetBandwidthUpdate(net, newBandwidth) < 0) - goto endjob; + if (net->type =3D=3D VIR_DOMAIN_NET_TYPE_NETWORK) { + if (virDomainNetBandwidthUpdate(net, newBandwidth) < 0) + goto endjob; + } else { + if (virNetDevBandwidthHasFloor(bandwidth)) { + char ifmac[VIR_MAC_STRING_BUFLEN]; + + virMacAddrFormat(&net->mac, ifmac); + virReportError(VIR_ERR_OPERATION_UNSUPPORTED, + _("Invalid use of 'floor' on interface with= MAC address %s " + "- 'floor' is only supported for interface = type 'network' with forward type 'nat', 'route', 'open' or none"), + ifmac); + goto endjob; + } + } =20 if (virNetDevBandwidthSet(net->ifname, newBandwidth, false, !virDomainNetTypeSharesHostView(net)) < = 0) { --=20 2.24.1