6 if not os
.access("/proc/xen", os
.R_OK
):
7 print 'System is not running a Xen kernel'
10 conn
= libvirt
.openReadOnly(None)
12 print 'Failed to open connection to the hypervisor'
16 (model
, memory
, cpus
, mhz
, nodes
, socket
, cores
, threads
) = conn
.getInfo()
18 print 'Failed to extract the current node information'
21 print "Xen running on %d %s processors at %d MHz, %d MBytes of memory" % (
22 cpus
, model
, mhz
, memory
)
24 if cpus
> nodes
* socket
* cores
* threads
:
25 print "Erroneous CPU information"
28 if cpus
< nodes
* socket
* cores
* threads
:
29 print "Strange, running in degrated mode, some CPU are not available"