From nobody Mon Dec 15 03:09:45 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) client-ip=209.132.183.28; envelope-from=libvir-list-bounces@redhat.com; helo=mx1.redhat.com; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 1528379679960103.89556861133849; Thu, 7 Jun 2018 06:54:39 -0700 (PDT) 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 mx1.redhat.com (Postfix) with ESMTPS id 6013D81122; Thu, 7 Jun 2018 13:54:38 +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 1524728D35; Thu, 7 Jun 2018 13:54:38 +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 6FB504CA84; Thu, 7 Jun 2018 13:54:37 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.rdu2.redhat.com [10.11.54.4]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id w57DsYSs000417 for ; Thu, 7 Jun 2018 09:54:34 -0400 Received: by smtp.corp.redhat.com (Postfix) id 125DA2026DFD; Thu, 7 Jun 2018 13:54:34 +0000 (UTC) Received: from caroline (unknown [10.43.2.67]) by smtp.corp.redhat.com (Postfix) with ESMTPS id C83522026DEF for ; Thu, 7 Jun 2018 13:54:33 +0000 (UTC) Received: from caroline.brq.redhat.com (caroline.usersys.redhat.com [127.0.0.1]) by caroline (Postfix) with ESMTP id CE6D012001E for ; Thu, 7 Jun 2018 15:54:32 +0200 (CEST) From: Martin Kletzander To: libvir-list@redhat.com Date: Thu, 7 Jun 2018 15:54:22 +0200 Message-Id: In-Reply-To: References: In-Reply-To: References: X-Scanned-By: MIMEDefang 2.78 on 10.11.54.4 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH 01/10] util: Rename resctrl to alloc if it is virResctrlAllocPtr 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: , MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable 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-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.28]); Thu, 07 Jun 2018 13:54:39 +0000 (UTC) X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" Just to stay consistent. Signed-off-by: Martin Kletzander Reviewed-by: J=EF=BF=BDn Tomko --- src/util/virresctrl.c | 64 +++++++++++++++++++++---------------------- src/util/virresctrl.h | 6 ++-- 2 files changed, 35 insertions(+), 35 deletions(-) diff --git a/src/util/virresctrl.c b/src/util/virresctrl.c index fc1163508ac1..c140276c0909 100644 --- a/src/util/virresctrl.c +++ b/src/util/virresctrl.c @@ -231,10 +231,10 @@ virResctrlAllocDispose(void *obj) size_t j =3D 0; size_t k =3D 0; =20 - virResctrlAllocPtr resctrl =3D obj; + virResctrlAllocPtr alloc =3D obj; =20 - for (i =3D 0; i < resctrl->nlevels; i++) { - virResctrlAllocPerLevelPtr level =3D resctrl->levels[i]; + for (i =3D 0; i < alloc->nlevels; i++) { + virResctrlAllocPerLevelPtr level =3D alloc->levels[i]; =20 if (!level) continue; @@ -259,9 +259,9 @@ virResctrlAllocDispose(void *obj) VIR_FREE(level); } =20 - VIR_FREE(resctrl->id); - VIR_FREE(resctrl->path); - VIR_FREE(resctrl->levels); + VIR_FREE(alloc->id); + VIR_FREE(alloc->path); + VIR_FREE(alloc->levels); } =20 =20 @@ -591,17 +591,17 @@ virResctrlInfoGetCache(virResctrlInfoPtr resctrl, =20 /* Alloc-related functions */ bool -virResctrlAllocIsEmpty(virResctrlAllocPtr resctrl) +virResctrlAllocIsEmpty(virResctrlAllocPtr alloc) { size_t i =3D 0; size_t j =3D 0; size_t k =3D 0; =20 - if (!resctrl) + if (!alloc) return true; =20 - for (i =3D 0; i < resctrl->nlevels; i++) { - virResctrlAllocPerLevelPtr a_level =3D resctrl->levels[i]; + for (i =3D 0; i < alloc->nlevels; i++) { + virResctrlAllocPerLevelPtr a_level =3D alloc->levels[i]; =20 if (!a_level) continue; @@ -629,30 +629,30 @@ virResctrlAllocIsEmpty(virResctrlAllocPtr resctrl) =20 =20 static virResctrlAllocPerTypePtr -virResctrlAllocGetType(virResctrlAllocPtr resctrl, +virResctrlAllocGetType(virResctrlAllocPtr alloc, unsigned int level, virCacheType type) { virResctrlAllocPerLevelPtr a_level =3D NULL; =20 - if (resctrl->nlevels <=3D level && - VIR_EXPAND_N(resctrl->levels, resctrl->nlevels, level - resctrl->n= levels + 1) < 0) + if (alloc->nlevels <=3D level && + VIR_EXPAND_N(alloc->levels, alloc->nlevels, level - alloc->nlevels= + 1) < 0) return NULL; =20 - if (!resctrl->levels[level]) { + if (!alloc->levels[level]) { virResctrlAllocPerTypePtr *types =3D NULL; =20 if (VIR_ALLOC_N(types, VIR_CACHE_TYPE_LAST) < 0) return NULL; =20 - if (VIR_ALLOC(resctrl->levels[level]) < 0) { + if (VIR_ALLOC(alloc->levels[level]) < 0) { VIR_FREE(types); return NULL; } - resctrl->levels[level]->types =3D types; + alloc->levels[level]->types =3D types; } =20 - a_level =3D resctrl->levels[level]; + a_level =3D alloc->levels[level]; =20 if (!a_level->types[type] && VIR_ALLOC(a_level->types[type]) < 0) return NULL; @@ -662,13 +662,13 @@ virResctrlAllocGetType(virResctrlAllocPtr resctrl, =20 =20 static int -virResctrlAllocUpdateMask(virResctrlAllocPtr resctrl, +virResctrlAllocUpdateMask(virResctrlAllocPtr alloc, unsigned int level, virCacheType type, unsigned int cache, virBitmapPtr mask) { - virResctrlAllocPerTypePtr a_type =3D virResctrlAllocGetType(resctrl, l= evel, type); + virResctrlAllocPerTypePtr a_type =3D virResctrlAllocGetType(alloc, lev= el, type); =20 if (!a_type) return -1; @@ -690,13 +690,13 @@ virResctrlAllocUpdateMask(virResctrlAllocPtr resctrl, =20 =20 static int -virResctrlAllocUpdateSize(virResctrlAllocPtr resctrl, +virResctrlAllocUpdateSize(virResctrlAllocPtr alloc, unsigned int level, virCacheType type, unsigned int cache, unsigned long long size) { - virResctrlAllocPerTypePtr a_type =3D virResctrlAllocGetType(resctrl, l= evel, type); + virResctrlAllocPerTypePtr a_type =3D virResctrlAllocGetType(alloc, lev= el, type); =20 if (!a_type) return -1; @@ -774,13 +774,13 @@ virResctrlAllocCheckCollision(virResctrlAllocPtr allo= c, =20 =20 int -virResctrlAllocSetSize(virResctrlAllocPtr resctrl, +virResctrlAllocSetSize(virResctrlAllocPtr alloc, unsigned int level, virCacheType type, unsigned int cache, unsigned long long size) { - if (virResctrlAllocCheckCollision(resctrl, level, type, cache)) { + if (virResctrlAllocCheckCollision(alloc, level, type, cache)) { virReportError(VIR_ERR_XML_ERROR, _("Colliding cache allocations for cache " "level '%u' id '%u', type '%s'"), @@ -788,12 +788,12 @@ virResctrlAllocSetSize(virResctrlAllocPtr resctrl, return -1; } =20 - return virResctrlAllocUpdateSize(resctrl, level, type, cache, size); + return virResctrlAllocUpdateSize(alloc, level, type, cache, size); } =20 =20 int -virResctrlAllocForeachSize(virResctrlAllocPtr resctrl, +virResctrlAllocForeachSize(virResctrlAllocPtr alloc, virResctrlAllocForeachSizeCallback cb, void *opaque) { @@ -802,11 +802,11 @@ virResctrlAllocForeachSize(virResctrlAllocPtr resctrl, unsigned int type =3D 0; unsigned int cache =3D 0; =20 - if (!resctrl) + if (!alloc) return 0; =20 - for (level =3D 0; level < resctrl->nlevels; level++) { - virResctrlAllocPerLevelPtr a_level =3D resctrl->levels[level]; + for (level =3D 0; level < alloc->nlevels; level++) { + virResctrlAllocPerLevelPtr a_level =3D alloc->levels[level]; =20 if (!a_level) continue; @@ -856,18 +856,18 @@ virResctrlAllocGetID(virResctrlAllocPtr alloc) =20 =20 char * -virResctrlAllocFormat(virResctrlAllocPtr resctrl) +virResctrlAllocFormat(virResctrlAllocPtr alloc) { virBuffer buf =3D VIR_BUFFER_INITIALIZER; unsigned int level =3D 0; unsigned int type =3D 0; unsigned int cache =3D 0; =20 - if (!resctrl) + if (!alloc) return NULL; =20 - for (level =3D 0; level < resctrl->nlevels; level++) { - virResctrlAllocPerLevelPtr a_level =3D resctrl->levels[level]; + for (level =3D 0; level < alloc->nlevels; level++) { + virResctrlAllocPerLevelPtr a_level =3D alloc->levels[level]; =20 if (!a_level) continue; diff --git a/src/util/virresctrl.h b/src/util/virresctrl.h index 5368ba211924..cc648b521e8f 100644 --- a/src/util/virresctrl.h +++ b/src/util/virresctrl.h @@ -79,17 +79,17 @@ virResctrlAllocPtr virResctrlAllocNew(void); =20 bool -virResctrlAllocIsEmpty(virResctrlAllocPtr resctrl); +virResctrlAllocIsEmpty(virResctrlAllocPtr alloc); =20 int -virResctrlAllocSetSize(virResctrlAllocPtr resctrl, +virResctrlAllocSetSize(virResctrlAllocPtr alloc, unsigned int level, virCacheType type, unsigned int cache, unsigned long long size); =20 int -virResctrlAllocForeachSize(virResctrlAllocPtr resctrl, +virResctrlAllocForeachSize(virResctrlAllocPtr alloc, virResctrlAllocForeachSizeCallback cb, void *opaque); =20 --=20 2.17.1 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list