Add a new param 'vcpu_time' to virDomainGetCPUStats

Currently virDomainGetCPUStats gets total cpu usage, which consists
of:

  1. vcpu usage: the physical cpu time consumed by virtual cpu(s) of
     domain
  2. hypervisor: `total cpu usage' - `vcpu usage'

The param 'vcpu_time' is for getting vcpu usages.
This commit is contained in:
Hu Tao
2012-05-09 16:41:37 +08:00
committed by Eric Blake
parent d9a269bc74
commit d29a7aaa1a
2 changed files with 17 additions and 7 deletions

View File

@@ -1339,7 +1339,8 @@ int virDomainGetState (virDomainPtr domain,
/**
* VIR_DOMAIN_CPU_STATS_CPUTIME:
* cpu usage in nanoseconds, as a ullong
* cpu usage (sum of both vcpu and hypervisor usage) in nanoseconds,
* as a ullong
*/
#define VIR_DOMAIN_CPU_STATS_CPUTIME "cpu_time"
@@ -1355,6 +1356,13 @@ int virDomainGetState (virDomainPtr domain,
*/
#define VIR_DOMAIN_CPU_STATS_SYSTEMTIME "system_time"
/**
* VIR_DOMAIN_CPU_STATS_VCPUTIME:
* vcpu usage in nanoseconds (cpu_time excluding hypervisor time),
* as a ullong
*/
#define VIR_DOMAIN_CPU_STATS_VCPUTIME "vcpu_time"
int virDomainGetCPUStats(virDomainPtr domain,
virTypedParameterPtr params,
unsigned int nparams,