Changeset 533 for trunk/packages/sipb-xen-remctl-auto/files/usr
- Timestamp:
- May 15, 2008, 8:58:19 PM (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/packages/sipb-xen-remctl-auto/files/usr/sbin/sipb-xen-listvms
r531 r533 2 2 3 3 import sys 4 import time 4 5 sys.path.insert(0, '/usr/lib/xen-3.1-1/lib/python') 5 6 from xen.lowlevel.xs import xs … … 9 10 def live_vms(): 10 11 domids = set(trans.ls('', '/local/domain')) 11 domids. remove('0')12 domids.discard('0') 12 13 13 14 vms = dict() … … 29 30 data['vm'] = trans.read('', '/local/domain/%d/vm' % domid) 30 31 data['start_time'] = float(trans.read('', '%s/start_time' % data['vm'])) 32 data['uptime'] = time.time()-data['start_time'] 31 33 32 34 return name, data … … 36 38 if '--pickle' in sys.argv[1:]: 37 39 import cPickle 38 cPickle.dump(vms, sys.stdout )40 cPickle.dump(vms, sys.stdout, cPickle.HIGHEST_PROTOCOL) 39 41 else: 40 42 print vms
Note: See TracChangeset
for help on using the changeset viewer.