[libvirt] [PATCH 1/6] virNodeGetCpuTime: Expose new API

Minoru Usui usui at mxm.nes.nec.co.jp
Fri Apr 1 01:55:48 UTC 2011


virNodeGetCpuTime: Expose new API

 include/libvirt/libvirt.h.in |   26 ++++++++++++++++++++++++++
 src/libvirt_public.syms      |    1 +
 2 files changed, 27 insertions(+), 0 deletions(-)

diff --git a/include/libvirt/libvirt.h.in b/include/libvirt/libvirt.h.in
index bd36015..b61ce9c 100644
--- a/include/libvirt/libvirt.h.in
+++ b/include/libvirt/libvirt.h.in
@@ -228,6 +228,21 @@ struct _virNodeInfo {
     unsigned int threads;/* number of threads per core */
 };
 
+/**
+ * virNodeCpuTime:
+ *
+ * a virNodeCpuTime is a structure filled by virNodeGetCpuTime() and providing
+ * the information for the cpu time of Node.
+ */
+
+typedef struct _virNodeCpuTime virNodeCpuTime;
+
+struct _virNodeCpuTime {
+    unsigned long long user;
+    unsigned long long system;
+    unsigned long long idle;
+    unsigned long long iowait;
+};
 
 /**
  * virDomainSchedParameterType:
@@ -460,6 +475,14 @@ int virDomainMigrateSetMaxSpeed(virDomainPtr domain,
 typedef virNodeInfo *virNodeInfoPtr;
 
 /**
+ * virNodeCpuTimePtr:
+ *
+ * a virNodeCpuTimePtr is a pointer to a virNodeCpuTime structure.
+ */
+
+typedef virNodeCpuTime *virNodeCpuTimePtr;
+
+/**
  * virConnectFlags
  *
  * Flags when opening a connection to a hypervisor
@@ -593,6 +616,9 @@ int                     virNodeGetInfo          (virConnectPtr conn,
                                                  virNodeInfoPtr info);
 char *                  virConnectGetCapabilities (virConnectPtr conn);
 
+int                     virNodeGetCpuTime       (virConnectPtr conn,
+                                                 virNodeCpuTimePtr cpu_time);
+
 unsigned long long      virNodeGetFreeMemory    (virConnectPtr conn);
 
 int                     virNodeGetSecurityModel (virConnectPtr conn,
diff --git a/src/libvirt_public.syms b/src/libvirt_public.syms
index b4aed41..53575e1 100644
--- a/src/libvirt_public.syms
+++ b/src/libvirt_public.syms
@@ -434,6 +434,7 @@ LIBVIRT_0.9.0 {
         virEventRunDefaultImpl;
         virStorageVolDownload;
         virStorageVolUpload;
+        virNodeGetCpuTime;
 } LIBVIRT_0.8.8;
 
 # .... define new API here using predicted next version number ....
-- 
1.7.1

-- 
Minoru Usui <usui at mxm.nes.nec.co.jp>




More information about the libvir-list mailing list