From nobody Mon Feb 9 12:25:31 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 205.139.110.120 as permitted sender) client-ip=205.139.110.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 205.139.110.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 [205.139.110.120]) by mx.zohomail.com with SMTPS id 1581697622820488.67579538432676; Fri, 14 Feb 2020 08:27:02 -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-116-IFYPmV__NoqTiLvm0VczlA-1; Fri, 14 Feb 2020 11:26:56 -0500 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 42D90107ACCC; Fri, 14 Feb 2020 16:26:51 +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 14FE919C6A; Fri, 14 Feb 2020 16:26:51 +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 D87A518089C8; Fri, 14 Feb 2020 16:26:49 +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 01EGQXGi028536 for ; Fri, 14 Feb 2020 11:26:33 -0500 Received: by smtp.corp.redhat.com (Postfix) id C17CF1001DF0; Fri, 14 Feb 2020 16:26:33 +0000 (UTC) Received: from localhost.localdomain.com (unknown [10.43.2.22]) by smtp.corp.redhat.com (Postfix) with ESMTP id 173E81001B28; Fri, 14 Feb 2020 16:26:32 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1581697619; 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=4DEvaT/aDQgC3SX4zEuUhLTDZ6tjHOZuAUxwZ2DW9t0=; b=VgyLwvj3zApnN8xiu6YE8w7UXaUgeH/opYrUmm1fqdTeu/NQMrl+EJPeLttspaems8eFX6 oH9H9BmJ6vhVYntOO7qRxPuU/jtX65wHvlVKdXalK2ofgLFplOmBmUwI00P4VNFLcBDC39 IOW6SyitDF5VtoXfx/bt2FK8tW3Ctmc= From: Pavel Mores To: libvir-list@redhat.com Subject: [libvirt PATCH v2 4/6] qemu: check if 'floor' is supported for given interface and network Date: Fri, 14 Feb 2020 17:26:22 +0100 Message-Id: <20200214162624.147825-5-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.84 on 10.5.11.23 X-MC-Unique: IFYPmV__NoqTiLvm0VczlA-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" Even if an interface of type 'network', setting 'floor' is only supported if the network's forward type is nat, route, open or none. Signed-off-by: Pavel Mores --- src/network/bridge_driver.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/network/bridge_driver.c b/src/network/bridge_driver.c index 14976c9821..72220e1c64 100644 --- a/src/network/bridge_driver.c +++ b/src/network/bridge_driver.c @@ -5065,6 +5065,16 @@ networkCheckBandwidth(virNetworkObjPtr obj, =20 virMacAddrFormat(ifaceMac, ifmac); =20 + if (virNetDevBandwidthHasFloor(ifaceBand) && + !virNetDevSupportBandwidthFloor(def->forward.type)) { + + virReportError(VIR_ERR_OPERATION_UNSUPPORTED, + _("Invalid use of 'floor' on interface with MAC add= ress %s " + "- 'floor' is only supported for interface type '= network' with forward type 'nat', 'route', 'open' or none"), + ifmac); + return -1; + } + if (virNetDevBandwidthHasFloor(ifaceBand) && !(netBand && netBand->in)= ) { virReportError(VIR_ERR_OPERATION_UNSUPPORTED, _("Invalid use of 'floor' on interface with MAC " --=20 2.24.1