Changeset 533 for trunk


Ignore:
Timestamp:
May 15, 2008, 8:58:19 PM (17 years ago)
Author:
quentin
Message:

Compute uptime on the server so time drift doesn't cause problems

Location:
trunk/packages/sipb-xen-remctl-auto
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/packages/sipb-xen-remctl-auto/debian/changelog

    r531 r533  
     1sipb-xen-remctl-auto (1.0.15) unstable; urgency=low
     2
     3  * Compute time differences on server to avoid drift
     4
     5 -- Quentin Smith <quentin@mit.edu>  Thu, 15 May 2008 20:58:04 -0400
     6
    17sipb-xen-remctl-auto (1.0.14) unstable; urgency=low
    28
  • trunk/packages/sipb-xen-remctl-auto/files/usr/sbin/sipb-xen-listvms

    r531 r533  
    22
    33import sys
     4import time
    45sys.path.insert(0, '/usr/lib/xen-3.1-1/lib/python')
    56from xen.lowlevel.xs import xs
     
    910def live_vms():
    1011    domids = set(trans.ls('', '/local/domain'))
    11     domids.remove('0')
     12    domids.discard('0')
    1213
    1314    vms = dict()
     
    2930    data['vm'] = trans.read('', '/local/domain/%d/vm' % domid)
    3031    data['start_time'] = float(trans.read('', '%s/start_time' % data['vm']))
     32    data['uptime'] = time.time()-data['start_time']
    3133   
    3234    return name, data
     
    3638    if '--pickle' in sys.argv[1:]:
    3739        import cPickle
    38         cPickle.dump(vms, sys.stdout)
     40        cPickle.dump(vms, sys.stdout, cPickle.HIGHEST_PROTOCOL)
    3941    else:
    4042        print vms
Note: See TracChangeset for help on using the changeset viewer.