- Timestamp:
- Jul 23, 2008, 12:57:23 AM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/packages/sipb-xen-remctl-auto/files/usr/sbin/sipb-xen-listvms
r712 r714 4 4 import time 5 5 sys.path.insert(0, '/usr/lib/xen-3.1-1/lib/python') 6 from xen. lowlevel.xs import xs6 from xen.xend.xenstore import xstransact 7 7 8 trans = xs()8 xst = xstransact.xstransact() 9 9 10 10 def live_vms(): 11 domids = set( trans.ls('','/local/domain'))11 domids = set(xst.List('/local/domain')) 12 12 domids.discard('0') 13 13 … … 25 25 26 26 def get_dom(domid): 27 name = trans.read('','/local/domain/%d/name' % domid)27 name = xst.Read('/local/domain/%d/name' % domid) 28 28 data = dict() 29 29 data['domid'] = domid 30 30 # presence of a graphical console 31 data['console'] = trans.read('','/local/domain/%d/device/vfb/0/state' % domid)31 data['console'] = xst.Read('/local/domain/%d/device/vfb/0/state' % domid) 32 32 # uptime 33 data['vm'] = trans.read('','/local/domain/%d/vm' % domid)34 data['start_time'] = float( trans.read('','%s/start_time' % data['vm']))33 data['vm'] = xst.Read('/local/domain/%d/vm' % domid) 34 data['start_time'] = float(xst.Read('%s/start_time' % data['vm'])) 35 35 data['uptime'] = time.time()-data['start_time'] 36 36
Note: See TracChangeset
for help on using the changeset viewer.