mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2024-08-28 19:41:16 +00:00
Move virCacheKernel enum implemetation from conf/ to util/
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 <mkletzan@redhat.com> Reviewed-by: Ján Tomko <jtomko@redhat.com>
This commit is contained in:
parent
c95b9557b5
commit
f1d7625e13
@ -1544,12 +1544,6 @@ virCapabilitiesInitPages(virCapsPtr caps)
|
|||||||
return ret;
|
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
|
bool
|
||||||
virCapsHostCacheBankEquals(virCapsHostCacheBankPtr a,
|
virCapsHostCacheBankEquals(virCapsHostCacheBankPtr a,
|
||||||
|
@ -2619,6 +2619,8 @@ virRandomInt;
|
|||||||
|
|
||||||
|
|
||||||
# util/virresctrl.h
|
# util/virresctrl.h
|
||||||
|
virCacheKernelTypeFromString;
|
||||||
|
virCacheKernelTypeToString;
|
||||||
virCacheTypeFromString;
|
virCacheTypeFromString;
|
||||||
virCacheTypeToString;
|
virCacheTypeToString;
|
||||||
virResctrlAllocAddPID;
|
virResctrlAllocAddPID;
|
||||||
|
@ -48,15 +48,24 @@ VIR_LOG_INIT("util.virresctrl")
|
|||||||
#define SYSFS_RESCTRL_PATH "/sys/fs/resctrl"
|
#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,
|
VIR_ENUM_IMPL(virCache, VIR_CACHE_TYPE_LAST,
|
||||||
"both",
|
"both",
|
||||||
"code",
|
"code",
|
||||||
"data")
|
"data")
|
||||||
/*
|
|
||||||
* This is the same enum, but for the resctrl naming
|
/* Cache name mapping for resctrl interface naming. */
|
||||||
* of the type (L<level><type>)
|
|
||||||
*/
|
|
||||||
VIR_ENUM_DECL(virResctrl)
|
VIR_ENUM_DECL(virResctrl)
|
||||||
VIR_ENUM_IMPL(virResctrl, VIR_CACHE_TYPE_LAST,
|
VIR_ENUM_IMPL(virResctrl, VIR_CACHE_TYPE_LAST,
|
||||||
"",
|
"",
|
||||||
|
@ -34,6 +34,7 @@ typedef enum {
|
|||||||
} virCacheType;
|
} virCacheType;
|
||||||
|
|
||||||
VIR_ENUM_DECL(virCache);
|
VIR_ENUM_DECL(virCache);
|
||||||
|
VIR_ENUM_DECL(virCacheKernel);
|
||||||
|
|
||||||
|
|
||||||
typedef struct _virResctrlInfoPerCache virResctrlInfoPerCache;
|
typedef struct _virResctrlInfoPerCache virResctrlInfoPerCache;
|
||||||
|
Loading…
Reference in New Issue
Block a user