Ignore:
Timestamp:
Jul 23, 2008, 12:57:23 AM (16 years ago)
Author:
price
Message:

use a slightly cleaner Xen API in listvms

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/packages/sipb-xen-remctl-auto/files/usr/sbin/sipb-xen-listvms

    r712 r714  
    44import time
    55sys.path.insert(0, '/usr/lib/xen-3.1-1/lib/python')
    6 from xen.lowlevel.xs import xs
     6from xen.xend.xenstore import xstransact
    77
    8 trans = xs()
     8xst = xstransact.xstransact()
    99
    1010def live_vms():
    11     domids = set(trans.ls('', '/local/domain'))
     11    domids = set(xst.List('/local/domain'))
    1212    domids.discard('0')
    1313
     
    2525
    2626def get_dom(domid):
    27     name = trans.read('', '/local/domain/%d/name' % domid)
     27    name = xst.Read('/local/domain/%d/name' % domid)
    2828    data = dict()
    2929    data['domid'] = domid
    3030    # 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)
    3232    # 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']))
    3535    data['uptime'] = time.time()-data['start_time']
    3636   
Note: See TracChangeset for help on using the changeset viewer.