ia64/xen-unstable

changeset 6848:bc5dbfe729e0

Move start_time out of xend dir and use gather/store.
Signed-off-by: Christian Limpach <Christian.Limpach@cl.cam.ac.uk>
author cl349@firebug.cl.cam.ac.uk
date Wed Sep 14 19:30:08 2005 +0000 (2005-09-14)
parents 960d4f6b58b3
children 1585590ec474
files tools/python/xen/xend/XendDomainInfo.py
line diff
     1.1 --- a/tools/python/xen/xend/XendDomainInfo.py	Wed Sep 14 19:29:25 2005 +0000
     1.2 +++ b/tools/python/xen/xend/XendDomainInfo.py	Wed Sep 14 19:30:08 2005 +0000
     1.3 @@ -149,7 +149,8 @@ class XendDomainInfo:
     1.4          path = "/".join(db.getPath().split("/")[0:-2])
     1.5          vm = cls(uuid, path, db)
     1.6          vm.setDomid(domid)
     1.7 -        vm.name = vm.readVm("name")
     1.8 +        vm.name, vm.start_time = vm.gatherVm(("name", str),
     1.9 +                                             ("start-time", float))
    1.10          try:
    1.11              db.readDB()
    1.12          except: pass
    1.13 @@ -204,7 +205,6 @@ class XendDomainInfo:
    1.14  
    1.15      __exports__ = [
    1.16          DBVar('config',        ty='sxpr'),
    1.17 -        DBVar('start_time',    ty='float'),
    1.18          DBVar('state',         ty='str'),
    1.19          DBVar('restart_mode',  ty='str'),
    1.20          DBVar('restart_state', ty='str'),
    1.21 @@ -274,6 +274,12 @@ class XendDomainInfo:
    1.22      def removeVm(self, *args):
    1.23          return xstransact.Remove(self.path, *args)
    1.24  
    1.25 +    def gatherVm(self, *args):
    1.26 +        return xstransact.Gather(self.path, *args)
    1.27 +
    1.28 +    def storeVm(self, *args):
    1.29 +        return xstransact.Store(self.path, *args)
    1.30 +
    1.31      def readDom(self, *args):
    1.32          return xstransact.Read(self.path, *args)
    1.33  
    1.34 @@ -283,6 +289,12 @@ class XendDomainInfo:
    1.35      def removeDom(self, *args):
    1.36          return xstransact.Remove(self.path, *args)
    1.37  
    1.38 +    def gatherDom(self, *args):
    1.39 +        return xstransact.Gather(self.path, *args)
    1.40 +
    1.41 +    def storeDom(self, *args):
    1.42 +        return xstransact.Store(self.path, *args)
    1.43 +
    1.44      def setDB(self, db):
    1.45          self.db = db
    1.46  
    1.47 @@ -800,6 +812,7 @@ class XendDomainInfo:
    1.48              return
    1.49          if self.start_time is None:
    1.50              self.start_time = time.time()
    1.51 +            self.storeVm(("start-time", self.start_time))
    1.52          try:
    1.53              cpu = int(sxp.child_value(self.config, 'cpu', '-1'))
    1.54          except: