From nobody Tue Feb 10 05:44:08 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 205.139.110.61 as permitted sender) client-ip=205.139.110.61; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-delivery-1.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 205.139.110.61 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-delivery-1.mimecast.com (us-smtp-1.mimecast.com [205.139.110.61]) by mx.zohomail.com with SMTPS id 1581351064858827.6100308821322; Mon, 10 Feb 2020 08:11:04 -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-349-NhzptLTDMYaVk6aJOnI9dg-1; Mon, 10 Feb 2020 11:10:58 -0500 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id EE8D1801E6C; Mon, 10 Feb 2020 16:10:52 +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 826B889F18; Mon, 10 Feb 2020 16:10:52 +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 75AB7866D7; Mon, 10 Feb 2020 16:10:50 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 01AGAlhC023778 for ; Mon, 10 Feb 2020 11:10:47 -0500 Received: by smtp.corp.redhat.com (Postfix) id CB16827073; Mon, 10 Feb 2020 16:10:47 +0000 (UTC) Received: from localhost.localdomain.com (unknown [10.43.2.22]) by smtp.corp.redhat.com (Postfix) with ESMTP id 2B3AD27067; Mon, 10 Feb 2020 16:10:47 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1581351063; 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=vEi/aGIDI5KSiDb/ziHpvTb2PFVjovdhv+v7zpfO328=; b=heoiOlBdvey1NUyfkxkpOtln+024QQytZ0SPaGNkBIjQHIxom3hMYDZklxLSjdxsMCv2mG fWTmhXTcxtbe+ddAxRw3xn1bmzHj3OKoG+xl7MZMqur9vVDm1k5bo2M0yiGZaOaHVzTCKE cC9KSNSZFsIRwXmGBHFX5DloBPrjyVk= From: Pavel Mores To: libvir-list@redhat.com Subject: [libvirt PATCH 1/5] qemu: fail on attempt to set 'floor' if interface type is not 'network' Date: Mon, 10 Feb 2020 17:10:37 +0100 Message-Id: <20200210161041.515468-2-pmores@redhat.com> In-Reply-To: <20200210161041.515468-1-pmores@redhat.com> References: <20200210161041.515468-1-pmores@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 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.11 X-MC-Unique: NhzptLTDMYaVk6aJOnI9dg-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 | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c index e69d083836..88fa56da42 100644 --- a/src/qemu/qemu_driver.c +++ b/src/qemu/qemu_driver.c @@ -11672,9 +11672,16 @@ 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 (bandwidth->in && bandwidth->in->floor !=3D 0) { + virReportError(VIR_ERR_OPERATION_UNSUPPORTED, "%s", + _("'floor' is only supported for interface = type 'network' with forward type 'nat', 'route', 'open' or none")); + goto endjob; + } + } =20 if (virNetDevBandwidthSet(net->ifname, newBandwidth, false, !virDomainNetTypeSharesHostView(net)) < = 0) { --=20 2.24.1