From nobody Mon Apr 29 07:29:05 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.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 (zoho.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 ARC-Seal: i=1; a=rsa-sha256; t=1573768706; cv=none; d=zoho.com; s=zohoarc; b=SuLe+zJH7RtdXkh/P8Ej8UeyHo7yH/0n+brBmRdqhYeAT/RfOVnIdWvyB4mU59es6tIYOkneRN4XnTdcaQRpcS2dmiPMdBoz//UFvoZ0s1nfJbDA5Q1Un2uUSwI0sds6PjvSw8ntdFT9lCDnUuhcsMV2WWie3ao9qm7jV/MhqIw= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1573768706; h=Content-Type:Content-Transfer-Encoding:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=qjTltCwbPifwBEFNnyJkfFB2gyciv5kMy8AEhsv8vsM=; b=WizFovZsOgkgCp1+tqwUIGhzrc2GJpJGARIJElo5Ws2RzLpWYEXrpr+fL3EtuTF5TD2+yHbJasQlVim8K+0cNbtc4ecc1SVQHa8YBYy3Z4AlgOj65ukBlbMcRZZZ6R/WiQ+gYhoS2Oelf2mscivCyikVDwnycKYfUI5+LNXHgCc= ARC-Authentication-Results: i=1; mx.zoho.com; dkim=pass; spf=pass (zoho.com: domain of redhat.com designates 205.139.110.61 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) header.from= 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 1573768706014340.13384133996817; Thu, 14 Nov 2019 13:58:26 -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-106-D_b7jAeMOBW9S7-jqTUDWA-1; Thu, 14 Nov 2019 16:58:23 -0500 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id E0B0D1005500; Thu, 14 Nov 2019 21:58:17 +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 6A9BA5F768; Thu, 14 Nov 2019 21:58:17 +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 29FBD18089D5; Thu, 14 Nov 2019 21:58:17 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id xAELwFbo017539 for ; Thu, 14 Nov 2019 16:58:15 -0500 Received: by smtp.corp.redhat.com (Postfix) id 1614360C18; Thu, 14 Nov 2019 21:58:15 +0000 (UTC) Received: from localhost.localdomain.com (ovpn-116-166.phx2.redhat.com [10.3.116.166]) by smtp.corp.redhat.com (Postfix) with ESMTP id C10C160C05 for ; Thu, 14 Nov 2019 21:58:14 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1573768704; 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=qjTltCwbPifwBEFNnyJkfFB2gyciv5kMy8AEhsv8vsM=; b=Cp0W6UrDOWJXISsu3AdGpi+s8blABajD54pWcHLFHs8YxcKXZiowJ8i2RvFVE0aUhGgVsW yE3WmQZjGE5JxrDrYI3/F4aUKFIy7FiM0C6vreoBdzwMTRxfwCw/P7XY1N9Q14KnSbVZ/M IprS2DwpVKh4Na+F8f3HCz8LetcUxuI= From: John Ferlan To: libvir-list@redhat.com Date: Thu, 14 Nov 2019 16:58:06 -0500 Message-Id: <20191114215808.16324-2-jferlan@redhat.com> In-Reply-To: <20191114215808.16324-1-jferlan@redhat.com> References: <20191114215808.16324-1-jferlan@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH 1/3] util: Remove unnecessary check in virFileRewrite 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.15 X-MC-Unique: D_b7jAeMOBW9S7-jqTUDWA-1 X-Mimecast-Spam-Score: 0 Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) Content-Type: text/plain; charset="utf-8" Since g_strdup_printf will abort, we know @newfile won't be NULL. Found by Coverity Signed-off-by: John Ferlan Reviewed-by: Daniel Henrique Barboza --- src/util/virfile.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/util/virfile.c b/src/util/virfile.c index cb6cfc0fe7..fca7ff9d35 100644 --- a/src/util/virfile.c +++ b/src/util/virfile.c @@ -543,8 +543,7 @@ virFileRewrite(const char *path, =20 cleanup: VIR_FORCE_CLOSE(fd); - if (newfile) - unlink(newfile); + unlink(newfile); return ret; } =20 --=20 2.20.1 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Mon Apr 29 07:29:05 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.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 (zoho.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 ARC-Seal: i=1; a=rsa-sha256; t=1573768713; cv=none; d=zoho.com; s=zohoarc; b=R5SJxOYUBubpC6XBhj0DancYCgsSbJP7gGCT+l4W8Pm2aYDoR/0KmI0r7aJcp0Ef9wynrxKZpZ/94TzkeiexYB+/drHYc7dK/do+mMtzIHX5pjwnySMDQo7+QqiS1rNXVKzsWblsGrozUy441DGsUs8Ij7VXyx+dziyLpCIEKP4= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1573768713; h=Content-Type:Content-Transfer-Encoding:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=HJsfFFNOObM0bXB7J5rVLYJ925v5NrthsNeXb1LhJcU=; b=M7bA379f547M65cT3ZW2YOgS/yQMQDoOj0puqjD1V38QP4wpFvBbZXn8h0fU2isPV1RU1OprTECjakCiNZuFjKnpbauB1eK3T1FBeqPEaw9DGCaxoSRn/wJRMqVw7oe7ZGNX8JDNJ2ZwyUdM8m0H6uIfiwDzgpULfVidXCZhTNw= ARC-Authentication-Results: i=1; mx.zoho.com; dkim=pass; spf=pass (zoho.com: domain of redhat.com designates 207.211.31.120 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) header.from= 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 157376871343064.12748636193783; Thu, 14 Nov 2019 13:58:33 -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-391-zRnIZqKwNHKm9IgoJggaQw-1; Thu, 14 Nov 2019 16:58:30 -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 EA237801E76; Thu, 14 Nov 2019 21:58:23 +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 C6ED6101F967; Thu, 14 Nov 2019 21:58:23 +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 89C9D4BB65; Thu, 14 Nov 2019 21:58:23 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id xAELwFUh017544 for ; Thu, 14 Nov 2019 16:58:15 -0500 Received: by smtp.corp.redhat.com (Postfix) id 8C00060C18; Thu, 14 Nov 2019 21:58:15 +0000 (UTC) Received: from localhost.localdomain.com (ovpn-116-166.phx2.redhat.com [10.3.116.166]) by smtp.corp.redhat.com (Postfix) with ESMTP id 4346360C05 for ; Thu, 14 Nov 2019 21:58:15 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1573768712; 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=HJsfFFNOObM0bXB7J5rVLYJ925v5NrthsNeXb1LhJcU=; b=FayVPZEGrdV62vxt7IbkP4SRGjYIWGzvTGygotECDpZZPhqn51IT284nS2bJZcqmhDoxX0 UQflYdavH5Phl6X8h8JG85EWDoBYnsNE0SNO6M/EbmxWKPdkC/7yS5cp/r4S4uP/RSv8VH SGNWo2+tWM78bzbnyOt6mw5CHf1EiTU= From: John Ferlan To: libvir-list@redhat.com Date: Thu, 14 Nov 2019 16:58:07 -0500 Message-Id: <20191114215808.16324-3-jferlan@redhat.com> In-Reply-To: <20191114215808.16324-1-jferlan@redhat.com> References: <20191114215808.16324-1-jferlan@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH 2/3] network: Use local variables in networkUpdatePortBandwidth 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: zRnIZqKwNHKm9IgoJggaQw-1 X-Mimecast-Spam-Score: 0 Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) Content-Type: text/plain; charset="utf-8" We go through the trouble of checking {old|new}Bandwidth[->in] and storing the result in local @old_floor and @new_floor, but then we don't use them. Instead we make derefs to the longer name. This caused Coverity to note dereferencing newBandwidth->in without first checking @newBandwidth like was done for new_floor could cause a NULL dereference. Signed-off-by: John Ferlan Reviewed-by: Daniel Henrique Barboza --- src/network/bridge_driver.c | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/src/network/bridge_driver.c b/src/network/bridge_driver.c index 7ee5d7ee53..68bb916501 100644 --- a/src/network/bridge_driver.c +++ b/src/network/bridge_driver.c @@ -5380,19 +5380,18 @@ networkUpdatePortBandwidth(virNetworkObjPtr obj, =20 /* Okay, there are three possible scenarios: */ =20 - if (oldBandwidth && oldBandwidth->in && oldBandwidth->in->floor && - newBandwidth->in && newBandwidth->in->floor) { + if (old_floor > 0 && new_floor > 0) { /* Either we just need to update @floor .. */ =20 if (virNetDevBandwidthUpdateRate(def->bridge, *class_id, def->bandwidth, - newBandwidth->in->floor) < 0) + new_floor) < 0) return -1; =20 tmp_floor_sum =3D virNetworkObjGetFloorSum(obj); - tmp_floor_sum -=3D oldBandwidth->in->floor; - tmp_floor_sum +=3D newBandwidth->in->floor; + tmp_floor_sum -=3D old_floor; + tmp_floor_sum +=3D new_floor; virNetworkObjSetFloorSum(obj, tmp_floor_sum); new_rate -=3D tmp_floor_sum; =20 @@ -5401,17 +5400,17 @@ networkUpdatePortBandwidth(virNetworkObjPtr obj, virNetworkObjSaveStatus(driver->stateDir, obj, network_driver->xmlopt) < 0) { /* Ouch, rollback */ - tmp_floor_sum -=3D newBandwidth->in->floor; - tmp_floor_sum +=3D oldBandwidth->in->floor; + tmp_floor_sum -=3D new_floor; + tmp_floor_sum +=3D old_floor; virNetworkObjSetFloorSum(obj, tmp_floor_sum); =20 ignore_value(virNetDevBandwidthUpdateRate(def->bridge, *class_id, def->bandwidth, - oldBandwidth->in->fl= oor)); + old_floor)); return -1; } - } else if (newBandwidth->in && newBandwidth->in->floor) { + } else if (new_floor > 0) { /* .. or we need to plug in new .. */ =20 if (networkPlugBandwidthImpl(obj, mac, newBandwidth, --=20 2.20.1 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Mon Apr 29 07:29:05 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of redhat.com designates 207.211.31.81 as permitted sender) client-ip=207.211.31.81; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-delivery-1.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zoho.com: domain of redhat.com designates 207.211.31.81 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1573768706; cv=none; d=zoho.com; s=zohoarc; b=j/2MKUj+rh9vYO0UaBBY+/K5f6fkYTDCGymyTzrWp0zlMZHldu7IGWpdNO6M3ezq4AVRZKy5M9VRKF9fkSUbQJ7HmSnx8WJuyJKafkcPfhl+/EGnQX0vHkHigytQZdEsFH6J9aXY7CRGFyWQ7mwsFbIk7jsaURU37CIxJSgkd7c= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1573768706; h=Content-Type:Content-Transfer-Encoding:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=tTftJDH2VvamCtSSCnK5acpbzUMgFWHrNW1P+ka5Q8g=; b=PrnJnm7vUqZq085TNJVwi8JrDd8EaJhpuXzoOsxlNIO2lYSt6+Ck5LTQjVPCmJRxeYPQ62cq4vliHamiW1vU79OgbaF7ztjtkc6hsYnpPpBZ9PA/cqHvPHK2t4Kk/uzuBNrhamIvPUOaTsxG8QBN+63SpZTzmnYwPOIGYfEJUcs= ARC-Authentication-Results: i=1; mx.zoho.com; dkim=pass; spf=pass (zoho.com: domain of redhat.com designates 207.211.31.81 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from us-smtp-delivery-1.mimecast.com (us-smtp-1.mimecast.com [207.211.31.81]) by mx.zohomail.com with SMTPS id 1573768706187432.46260809991327; Thu, 14 Nov 2019 13:58:26 -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-65-CnpJpgvJPDOoV2cdynlJEA-1; Thu, 14 Nov 2019 16:58:23 -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 4A589801FD2; Thu, 14 Nov 2019 21:58:17 +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 2037BA7E9; Thu, 14 Nov 2019 21:58:17 +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 C18BB18089CD; Thu, 14 Nov 2019 21:58:16 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id xAELwGLx017549 for ; Thu, 14 Nov 2019 16:58:16 -0500 Received: by smtp.corp.redhat.com (Postfix) id 1611960C05; Thu, 14 Nov 2019 21:58:16 +0000 (UTC) Received: from localhost.localdomain.com (ovpn-116-166.phx2.redhat.com [10.3.116.166]) by smtp.corp.redhat.com (Postfix) with ESMTP id BA26660C18 for ; Thu, 14 Nov 2019 21:58:15 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1573768705; 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=tTftJDH2VvamCtSSCnK5acpbzUMgFWHrNW1P+ka5Q8g=; b=YDyPbx944EyOFJsVxA+kHTbrtvI9wEwJuYarX07c72b2he0xa/zh5PSKE4pdg1HKDcBDjF RJGh1fMCnPyHfoyGVmejDLrCpyM2McQrs6XXvVpxlP3ccp6lWhPn0jvrlDenQutiF2WcRM fK8nOzFeMggQeftp0wnZswiHjsnurc4= From: John Ferlan To: libvir-list@redhat.com Date: Thu, 14 Nov 2019 16:58:08 -0500 Message-Id: <20191114215808.16324-4-jferlan@redhat.com> In-Reply-To: <20191114215808.16324-1-jferlan@redhat.com> References: <20191114215808.16324-1-jferlan@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH 3/3] network: Check for QOS before blindly using it 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: CnpJpgvJPDOoV2cdynlJEA-1 X-Mimecast-Spam-Score: 0 Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) Content-Type: text/plain; charset="utf-8" If networkAllocatePort calls networkPlugBandwidth eventually the port->bandwidth would be passed to virNetDevBandwidthPlug which requires that the parameter is non-NULL. Coverity additionally notes that since (!port->bandwidth) is checked earlier in the networkAllocatePort method that the subsequent call to blindly use if for a function that requires it needs to check. Signed-off-by: John Ferlan Reviewed-by: Daniel Henrique Barboza --- src/network/bridge_driver.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/src/network/bridge_driver.c b/src/network/bridge_driver.c index 68bb916501..9c49c70564 100644 --- a/src/network/bridge_driver.c +++ b/src/network/bridge_driver.c @@ -4567,6 +4567,13 @@ networkAllocatePort(virNetworkObjPtr obj, return -1; } =20 + if (!port->bandwidth) { + virReportError(VIR_ERR_CONFIG_UNSUPPORTED, + _("QOS must be defined for network '%s'"), + netdef->name); + return -1; + } + if (networkPlugBandwidth(obj, &port->mac, port->bandwidth, &port->= class_id) < 0) return -1; break; @@ -4633,6 +4640,13 @@ networkAllocatePort(virNetworkObjPtr obj, } } =20 + if (!port->bandwidth) { + virReportError(VIR_ERR_CONFIG_UNSUPPORTED, + _("QOS must be defined for network '%s'"), + netdef->name); + return -1; + } + if (networkPlugBandwidth(obj, &port->mac, port->bandwidth, &po= rt->class_id) < 0) return -1; break; --=20 2.20.1 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list