[libvirt] [PATCH 0/4] Add new public API virDomainGetPcpusUsage and pcpuinfo command in virsh

Lai Jiangshan laijs at cn.fujitsu.com
Thu Dec 15 08:34:08 UTC 2011

Hi, Eric

On 12/08/2011 11:44 AM, Eric Blake wrote:
> On 12/07/2011 08:40 PM, Lai Jiangshan wrote:
>> "virt-top -1" can call virDomainGetPcpusUsage() periodically and get
>> the CPU activities per CPU. (still require virt-top site patch).
>> virsh is also added a pcpuinfo command which calls virDomainGetPcpusUsage(),
>> it gets information about the physic CPUs, such as the usage of
>> CPUs, the current attached vCPUs.
> Meta-question - is this the time taken _by just the guest in question_
> on the host's physical CPU, or is it the cumulative CPU time taken by
> all process on the physical CPU, in which case this would be better
> named as virNodeGetCpusUsage()?  

It's per-domain usage.

> And if it is per-domain, then what's
> the difference between physical cpu usage and virtual cpu usage 

the API tell us how many cpu utilization the whole guest occupies for
every physic CPUs. I don't know what is "virtual cpu usage" means.

> (that
> is, can we even tell the overhead of the hypervisor, and should we be
> exposing that overhead to the user)?

it is not exposed to the normal user.

the administrator can use "virt-top -1" or "virsh pcpuinfo" to get cpus
usage, to find out which physic cpu is busy, to change the cpu bound of (new) guests,
to find a proper physic cpu and offline it, or to do nothing, just to observe the stat of the guests.

I/(I will) very appreciate for your reply.


More information about the libvir-list mailing list