diff --git a/src/conf/capabilities.c b/src/conf/capabilities.c index 978edf8719..7a810efa66 100644 --- a/src/conf/capabilities.c +++ b/src/conf/capabilities.c @@ -1544,12 +1544,6 @@ virCapabilitiesInitPages(virCapsPtr caps) return ret; } -/* Cache name mapping for Linux kernel naming */ -VIR_ENUM_DECL(virCacheKernel); -VIR_ENUM_IMPL(virCacheKernel, VIR_CACHE_TYPE_LAST, - "Unified", - "Instruction", - "Data") bool virCapsHostCacheBankEquals(virCapsHostCacheBankPtr a, diff --git a/src/libvirt_private.syms b/src/libvirt_private.syms index 3f54790297..2245101590 100644 --- a/src/libvirt_private.syms +++ b/src/libvirt_private.syms @@ -2619,6 +2619,8 @@ virRandomInt; # util/virresctrl.h +virCacheKernelTypeFromString; +virCacheKernelTypeToString; virCacheTypeFromString; virCacheTypeToString; virResctrlAllocAddPID; diff --git a/src/util/virresctrl.c b/src/util/virresctrl.c index 06a85d0d40..7796e43288 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" -/* 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 a348fa7ab1..9052a2b19a 100644 --- a/src/util/virresctrl.h +++ b/src/util/virresctrl.h @@ -34,6 +34,7 @@ typedef enum { } virCacheType; VIR_ENUM_DECL(virCache); +VIR_ENUM_DECL(virCacheKernel); typedef struct _virResctrlInfoPerCache virResctrlInfoPerCache;