From nobody Mon Feb 9 13:57:36 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 1581697603987244.6466008753846; Fri, 14 Feb 2020 08:26:43 -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-346-8n_0VkWyNf6XT5K-pe7KHA-1; Fri, 14 Feb 2020 11:26:39 -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 8E68A8017CC; Fri, 14 Feb 2020 16:26:34 +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 826AD83865; Fri, 14 Feb 2020 16:26:33 +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 694EB18089CD; Fri, 14 Feb 2020 16:26:32 +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 01EGQVrC028513 for ; Fri, 14 Feb 2020 11:26:31 -0500 Received: by smtp.corp.redhat.com (Postfix) id B846D1001B34; Fri, 14 Feb 2020 16:26:31 +0000 (UTC) Received: from localhost.localdomain.com (unknown [10.43.2.22]) by smtp.corp.redhat.com (Postfix) with ESMTP id 139CE1001B28; Fri, 14 Feb 2020 16:26:30 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1581697602; 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=gVhJ0yyoGr5tvoRiBRUrlvl6B2wdQoac/k/oxWXqrp0=; b=iCUB5rTYgQZZWU6s42Seek/3XF72zzkG2j/HPA8IZ2Hf0goYCpDr3NC58D8s2AudUEah8I tHr5Km+EWREe5avHHVe1KBbsdjYNTe5JFEFAYXjkYljNNkd0uJ9nb88p+e0AOfb9vNsUqw L3OmYJKBhFuU8PAFuy7lJH2IyFXYJuY= From: Pavel Mores To: libvir-list@redhat.com Subject: [libvirt PATCH v2 2/6] qemu: add function to test if network supports setting 'floor' Date: Fri, 14 Feb 2020 17:26:20 +0100 Message-Id: <20200214162624.147825-3-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.11 X-MC-Unique: 8n_0VkWyNf6XT5K-pe7KHA-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" This function will be useful in upcoming commits when code to check whether a network can support 'floor' in the first place is introduced. Signed-off-by: Pavel Mores --- src/conf/netdev_bandwidth_conf.h | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/src/conf/netdev_bandwidth_conf.h b/src/conf/netdev_bandwidth_c= onf.h index 5b5ed52566..0596d555e5 100644 --- a/src/conf/netdev_bandwidth_conf.h +++ b/src/conf/netdev_bandwidth_conf.h @@ -60,6 +60,26 @@ static inline bool virNetDevSupportBandwidth(virDomainNe= tType type) } =20 =20 +static inline bool virNetDevSupportBandwidthFloor(virNetworkForwardType ty= pe) +{ + switch (type) { + case VIR_NETWORK_FORWARD_NONE: + case VIR_NETWORK_FORWARD_NAT: + case VIR_NETWORK_FORWARD_ROUTE: + case VIR_NETWORK_FORWARD_OPEN: + return true; + case VIR_NETWORK_FORWARD_BRIDGE: + case VIR_NETWORK_FORWARD_PRIVATE: + case VIR_NETWORK_FORWARD_VEPA: + case VIR_NETWORK_FORWARD_PASSTHROUGH: + case VIR_NETWORK_FORWARD_HOSTDEV: + case VIR_NETWORK_FORWARD_LAST: + break; + } + return false; +} + + static inline bool virNetDevBandwidthHasFloor(const virNetDevBandwidth *b) { return b && b->in && b->in->floor !=3D 0; --=20 2.24.1