[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

Re: [libvirt] [PATCH V4 1/5] Add new public API virDomainGetCPUStats()



[I see you cc'd Eric redhat com; unfortunately, that doesn't forward to
me - at least I saw it on-list :) ]

On 01/27/2012 11:20 PM, KAMEZAWA Hiroyuki wrote:
> 
> add new API virDomainGetCPUStats() for getting cpu accounting information
> per real cpus which is used by a domain.
> 

> +++ b/include/libvirt/libvirt.h.in
> @@ -3797,6 +3797,12 @@ int virConnectSetKeepAlive(virConnectPtr conn,
>                             int interval,
>                             unsigned int count);
>  
> +int virDomainGetCPUStats(virDomainPtr domain,
> +                         virTypedParameterPtr params,
> +                         unsigned int nparams,
> +                         int start_cpu,
> +                         unsigned int ncpus,
> +                         unsigned int flags);
>  #ifdef __cplusplus

Phooey - I didn't notice this earlier, but we like new API to occur in
context (all the virDomain calls in sequence), and not slammed at the
bottom of the file (where we sunk the deprecated interfaces).

I'm pushing this followup as trivial (it is purely code motion and doc
comments).diff --git i/include/libvirt/libvirt.h.in
w/include/libvirt/libvirt.h.in
index f55fac3..0a7b324 100644
--- i/include/libvirt/libvirt.h.in
+++ w/include/libvirt/libvirt.h.in
@@ -1127,6 +1127,10 @@ char *                  virConnectGetURI
(virConnectPtr conn);
 char *                  virConnectGetSysinfo    (virConnectPtr conn,
                                                  unsigned int flags);

+int virConnectSetKeepAlive(virConnectPtr conn,
+                           int interval,
+                           unsigned int count);
+

 /*
  * Capabilities of the connection / driver.
@@ -1299,14 +1303,29 @@ char *                  virDomainScreenshot
(virDomainPtr domain,
                                                  unsigned int flags);

 /*
- * Domain runtime information
+ * Domain runtime information, and collecting CPU statistics
  */
+
 int                     virDomainGetInfo        (virDomainPtr domain,
                                                  virDomainInfoPtr info);
 int                     virDomainGetState       (virDomainPtr domain,
                                                  int *state,
                                                  int *reason,
                                                  unsigned int flags);
+
+/**
+ * VIR_DOMAIN_CPU_STATS_CPUTIME:
+ * cpu usage in nanoseconds, as a ullong
+ */
+#define VIR_DOMAIN_CPU_STATS_CPUTIME "cpu_time"
+
+int virDomainGetCPUStats(virDomainPtr domain,
+                         virTypedParameterPtr params,
+                         unsigned int nparams,
+                         int start_cpu,
+                         unsigned int ncpus,
+                         unsigned int flags);
+
 int                     virDomainGetControlInfo (virDomainPtr domain,

virDomainControlInfoPtr info,
                                                  unsigned int flags);
@@ -3807,24 +3826,6 @@ typedef struct _virTypedParameter virMemoryParameter;
  */
 typedef virMemoryParameter *virMemoryParameterPtr;

-int virConnectSetKeepAlive(virConnectPtr conn,
-                           int interval,
-                           unsigned int count);
-
-/* Collecting CPU statistics */
-
-/**
- * VIR_DOMAIN_CPU_STATS_CPUTIME:
- * cpu usage in nanoseconds, as a ullong
- */
-#define VIR_DOMAIN_CPU_STATS_CPUTIME "cpu_time"
-
-int virDomainGetCPUStats(virDomainPtr domain,
-                         virTypedParameterPtr params,
-                         unsigned int nparams,
-                         int start_cpu,
-                         unsigned int ncpus,
-                         unsigned int flags);
 #ifdef __cplusplus
 }
 #endif

-- 
Eric Blake   eblake redhat com    +1-919-301-3266
Libvirt virtualization library http://libvirt.org

Attachment: signature.asc
Description: OpenPGP digital signature


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]