From nobody Wed May 14 00:13:25 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 1528379700938896.1757556102957; Thu, 7 Jun 2018 06:55:00 -0700 (PDT) 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 mx1.redhat.com (Postfix) with ESMTPS id 9D3D33082138; Thu, 7 Jun 2018 13:54:59 +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 3C9EF5D75A; Thu, 7 Jun 2018 13:54:59 +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 CF4E5180BA88; Thu, 7 Jun 2018 13:54:58 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.rdu2.redhat.com [10.11.54.5]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id w57Dsclg000487 for ; Thu, 7 Jun 2018 09:54:38 -0400 Received: by smtp.corp.redhat.com (Postfix) id 9358D1C66F; Thu, 7 Jun 2018 13:54:38 +0000 (UTC) Received: from caroline (unknown [10.43.2.67]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 716C06F9E1 for ; Thu, 7 Jun 2018 13:54:35 +0000 (UTC) Received: from caroline.brq.redhat.com (caroline.usersys.redhat.com [127.0.0.1]) by caroline (Postfix) with ESMTP id 27F16120071 for ; Thu, 7 Jun 2018 15:54:33 +0200 (CEST) From: Martin Kletzander To: libvir-list@redhat.com Date: Thu, 7 Jun 2018 15:54:29 +0200 Message-Id: <222041a57ba5b86bb1e23649c39a7945985ab8c7.1528377367.git.mkletzan@redhat.com> In-Reply-To: References: In-Reply-To: References: X-Scanned-By: MIMEDefang 2.79 on 10.11.54.5 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH 08/10] Move virCacheKernel enum implemetation from conf/ to util/ 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.79 on 10.5.11.15 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.42]); Thu, 07 Jun 2018 13:55:00 +0000 (UTC) X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" It will be used in that file later on, plus it makes sense for all the implementations to be in same place. Also comment each one of them nicely = and add a comment explaining why they all need to end with the same _LAST value. Signed-off-by: Martin Kletzander Reviewed-by: J=EF=BF=BDn Tomko --- src/conf/capabilities.c | 6 ------ src/libvirt_private.syms | 2 ++ src/util/virresctrl.c | 19 ++++++++++++++----- src/util/virresctrl.h | 1 + 4 files changed, 17 insertions(+), 11 deletions(-) diff --git a/src/conf/capabilities.c b/src/conf/capabilities.c index 978edf871943..7a810efa6662 100644 --- a/src/conf/capabilities.c +++ b/src/conf/capabilities.c @@ -1544,12 +1544,6 @@ virCapabilitiesInitPages(virCapsPtr caps) return ret; } =20 -/* Cache name mapping for Linux kernel naming */ -VIR_ENUM_DECL(virCacheKernel); -VIR_ENUM_IMPL(virCacheKernel, VIR_CACHE_TYPE_LAST, - "Unified", - "Instruction", - "Data") =20 bool virCapsHostCacheBankEquals(virCapsHostCacheBankPtr a, diff --git a/src/libvirt_private.syms b/src/libvirt_private.syms index 20ec8760ec27..a4a0c95b474d 100644 --- a/src/libvirt_private.syms +++ b/src/libvirt_private.syms @@ -2619,6 +2619,8 @@ virRandomInt; =20 =20 # util/virresctrl.h +virCacheKernelTypeFromString; +virCacheKernelTypeToString; virCacheTypeFromString; virCacheTypeToString; virResctrlAllocAddPID; diff --git a/src/util/virresctrl.c b/src/util/virresctrl.c index 4e35b19649ca..481577bbb9f6 100644 --- a/src/util/virresctrl.c +++ b/src/util/virresctrl.c @@ -48,15 +48,24 @@ VIR_LOG_INIT("util.virresctrl") #define SYSFS_RESCTRL_PATH "/sys/fs/resctrl" =20 =20 -/* Our naming for cache types and scopes */ +/* Following are three different enum implementations for the same enum. = Each + * one of them helps translating to/from strings for different interfaces.= The + * delimiter must be VIR_CACHE_TYPE_LAST for all of them in order to stay + * consistent in between all of them. */ + +/* Cache name mapping for Linux kernel naming. */ +VIR_ENUM_IMPL(virCacheKernel, VIR_CACHE_TYPE_LAST, + "Unified", + "Instruction", + "Data") + +/* Cache name mapping for our XML naming. */ VIR_ENUM_IMPL(virCache, VIR_CACHE_TYPE_LAST, "both", "code", "data") -/* - * This is the same enum, but for the resctrl naming - * of the type (L) - */ + +/* Cache name mapping for resctrl interface naming. */ VIR_ENUM_DECL(virResctrl) VIR_ENUM_IMPL(virResctrl, VIR_CACHE_TYPE_LAST, "", diff --git a/src/util/virresctrl.h b/src/util/virresctrl.h index a348fa7ab195..9052a2b19a02 100644 --- a/src/util/virresctrl.h +++ b/src/util/virresctrl.h @@ -34,6 +34,7 @@ typedef enum { } virCacheType; =20 VIR_ENUM_DECL(virCache); +VIR_ENUM_DECL(virCacheKernel); =20 =20 typedef struct _virResctrlInfoPerCache virResctrlInfoPerCache; --=20 2.17.1 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list