mirror of
https://github.com/xen-project/xen.git
synced 2026-10-29 10:40:03 +01:00
21 lines
495 B
Python
21 lines
495 B
Python
#!/usr/bin/env python
|
|
|
|
# Get information about the physical host machine
|
|
|
|
import Xc
|
|
|
|
xc = Xc.new()
|
|
|
|
info = xc.physinfo()
|
|
|
|
fmt_info = [ ( 'CPU cores', info['cores']),
|
|
('Hyperthreads per core', info['ht_per_core']),
|
|
('CPU Speed (MHz)', info['cpu_khz'] / 1000),
|
|
('Total physical mem (MB)', info['total_pages'] / 256),
|
|
('Free physical mem (MB)', info['free_pages'] / 256) ]
|
|
|
|
|
|
for (item, val) in fmt_info:
|
|
print "%-23s" % item, ':', val
|
|
|