]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
Move virCacheKernel enum implemetation from conf/ to util/
authorMartin Kletzander <mkletzan@redhat.com>
Thu, 8 Feb 2018 14:55:09 +0000 (15:55 +0100)
committerMartin Kletzander <mkletzan@redhat.com>
Fri, 8 Jun 2018 08:28:46 +0000 (10:28 +0200)
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>
src/conf/capabilities.c
src/libvirt_private.syms
src/util/virresctrl.c
src/util/virresctrl.h

index 978edf871943efc2df33c61289f6e38e626692ce..7a810efa666229e4be2329f0397ceda8ebea5359 100644 (file)
@@ -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,
index 3f54790297fba8104bd672b16177c6fb75fb3ce7..2245101590a7c5857154e04d4adf7a35c470ea63 100644 (file)
@@ -2619,6 +2619,8 @@ virRandomInt;
 
 
 # util/virresctrl.h
+virCacheKernelTypeFromString;
+virCacheKernelTypeToString;
 virCacheTypeFromString;
 virCacheTypeToString;
 virResctrlAllocAddPID;
index 06a85d0d409841a35b84d146f6d02f645a45a692..7796e432886f285ca9915d9786cc41eb4c024cb5 100644 (file)
@@ -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<level><type>)
- */
+
+/* Cache name mapping for resctrl interface naming. */
 VIR_ENUM_DECL(virResctrl)
 VIR_ENUM_IMPL(virResctrl, VIR_CACHE_TYPE_LAST,
               "",
index a348fa7ab195a55462b7f80be76aedbb2a4cee1f..9052a2b19a02b6eef847ba628955a983d1929a45 100644 (file)
@@ -34,6 +34,7 @@ typedef enum {
 } virCacheType;
 
 VIR_ENUM_DECL(virCache);
+VIR_ENUM_DECL(virCacheKernel);
 
 
 typedef struct _virResctrlInfoPerCache virResctrlInfoPerCache;