]> xenbits.xensource.com Git - libvirt.git/commitdiff
virNodeGetMemoryStats: Expose new API
authorMinoru Usui <usui@mxm.nes.nec.co.jp>
Tue, 7 Jun 2011 01:03:36 +0000 (10:03 +0900)
committerEric Blake <eblake@redhat.com>
Tue, 14 Jun 2011 22:07:47 +0000 (16:07 -0600)
Signed-off-by: Minoru Usui <usui@mxm.nes.nec.co.jp>
include/libvirt/libvirt.h.in
python/generator.py
src/libvirt_public.syms

index 4bd2cdcd4644ff20082312a19bb3a017289d3bd6..b03a792193b2bf4074db05fd27d176b8adf4f509 100644 (file)
@@ -361,6 +361,70 @@ struct _virCPUStats {
     unsigned long long value;
 };
 
+/**
+ * VIR_MEMORY_STATS_FIELD_LENGTH:
+ *
+ * Macro providing the field length of virMemoryStats
+ */
+#define VIR_MEMORY_STATS_FIELD_LENGTH 80
+
+/**
+ * VIR_MEMORY_STATS_ALL_CELLS:
+ *
+ * Macro for the total memory of all cells.
+ */
+#define VIR_MEMORY_STATS_ALL_CELLS (-1)
+
+/**
+ * VIR_MEMORY_STATS_TOTAL:
+ *
+ * Macro for the total memory of specified cell:
+ * it represents the maximum memory.
+ */
+
+#define VIR_MEMORY_STATS_TOTAL "total"
+
+/**
+ * VIR_MEMORY_STATS_FREE:
+ *
+ * Macro for the free memory of specified cell:
+ * On linux, it includes buffer and cached memory, in case of
+ * VIR_MEMORY_STATS_ALL_CELLS.
+ */
+
+#define VIR_MEMORY_STATS_FREE "free"
+
+/**
+ * VIR_MEMORY_STATS_BUFFERS:
+ *
+ * Macro for the buffer memory: On linux, it only returns in case of
+ * VIR_MEMORY_STATS_ALL_CELLS.
+ */
+
+#define VIR_MEMORY_STATS_BUFFERS "buffers"
+
+/**
+ * VIR_MEMORY_STATS_CACHED:
+ *
+ * Macro for the cached memory: On linux, it only returns in case of
+ * VIR_MEMORY_STATS_ALL_CELLS.
+ */
+
+#define VIR_MEMORY_STATS_CACHED "cached"
+
+/**
+ * virMemoryStats:
+ *
+ * a virMemoryStats is a structure filled by virNodeGetMemoryStats()
+ * and providing the information of the memory of the Node.
+ */
+
+typedef struct _virMemoryStats virMemoryStats;
+
+struct _virMemoryStats {
+    char field[VIR_MEMORY_STATS_FIELD_LENGTH];
+    unsigned long long value;
+};
 
 /* Common data types shared among interfaces with name/type/value lists.  */
 
@@ -628,6 +692,14 @@ typedef virNodeInfo *virNodeInfoPtr;
 
 typedef virCPUStats *virCPUStatsPtr;
 
+/**
+ * virMemoryStatsPtr:
+ *
+ * a virMemoryStatsPtr is a pointer to a virMemoryStats structure.
+ */
+
+typedef virMemoryStats *virMemoryStatsPtr;
+
 /**
  * virConnectFlags
  *
@@ -768,6 +840,12 @@ int                     virNodeGetCPUStats (virConnectPtr conn,
                                             int *nparams,
                                             unsigned int flags);
 
+int                     virNodeGetMemoryStats (virConnectPtr conn,
+                                               int cellNum,
+                                               virCPUStatsPtr params,
+                                               int *nparams,
+                                               unsigned int flags);
+
 unsigned long long      virNodeGetFreeMemory    (virConnectPtr conn);
 
 int                     virNodeGetSecurityModel (virConnectPtr conn,
index d929efa42eb05ca38cc833dc79b27c13d35ee788..a14b9ce2d04a1f2e536d393ae49f911ea76cdcf3 100755 (executable)
@@ -364,6 +364,7 @@ skip_impl = (
     'virDomainRevertToSnapshot',
     'virDomainSendKey',
     'virNodeGetCPUStats',
+    'virNodeGetMemoryStats',
 )
 
 
index af559b6366c09aa6c40063bd1b371163d0863472..362dbed070de7348b3b340f0838ead34154baf6f 100644 (file)
@@ -455,6 +455,7 @@ LIBVIRT_0.9.3 {
         virDomainPinVcpuFlags;
         virDomainSendKey;
         virNodeGetCPUStats;
+        virNodeGetMemoryStats;
 } LIBVIRT_0.9.2;
 
 # .... define new API here using predicted next version number ....