[libvirt] cpu values

Tavares, John John_Tavares at bmc.com
Fri Mar 12 12:30:44 UTC 2010

As an example to show xm and virsh are reporting the same values:

$ sudo virsh dominfo 0
Id:             0
Name:           Domain-0
UUID:           00000000-0000-0000-0000-000000000000
OS Type:        linux
State:          running
CPU(s):         1
CPU time:       74108.3s
Max memory:     no limit       
Used memory:    763924 kB

$ sudo /usr/sbin/xm vcpu-list                  
Name                              ID VCPUs   CPU State   Time(s) CPU Affinity
Domain-0                           0     0     0   r--   74108.6 any cpu
rhel5_01                           1     0     0   -b-   18642.5 any cpu

$ cat /proc/stat | grep cpu
cpu  414247 1485212 523903 1116332612 350887 0 262 488367
cpu0 414247 1485212 523903 1116332612 350887 0 262 488367

-----Original Message-----
From: Tavares, John 
Sent: Friday, March 12, 2010 7:19 AM
To: 'veillard at redhat.com'
Cc: libvir-list at redhat.com
Subject: RE: [libvirt] cpu values

Hi Dan.

Ok, thanks.  I am trying to play around with this and noticed that my code with does use libvirt reports the exact same values as xm.  Either way, I do not see the values even being close.  Is this expected and if so why??

-----Original Message-----
From: Daniel Veillard [mailto:veillard at redhat.com] 
Sent: Friday, March 12, 2010 5:44 AM
To: Tavares, John
Cc: libvir-list at redhat.com
Subject: Re: [libvirt] cpu values

On Thu, Mar 11, 2010 at 04:46:45PM -0600, Tavares, John wrote:
> I am trying to compare the results that I am getting on a RHEL 5.3 server using xm list (using libvirt.so.0.3.3) against both my Dom0 and my Linux DomU on the same server to see if the cpu values match to what the kernel is reporting in /proc/stat.  Here is an example of what I am seeing on both:

  I'm aftaid you're confused. xm is the xen direct command line tool
it doesn't use libvirt at all. libvirt command line tool equivalent is


Daniel Veillard      | libxml Gnome XML XSLT toolkit  http://xmlsoft.org/
daniel at veillard.com  | Rpmfind RPM search engine http://rpmfind.net/
http://veillard.com/ | virtualization library  http://libvirt.org/

More information about the libvir-list mailing list