ia64/xen-unstable

changeset 5911:f24fcd22c68f

Introduce dom0 to the store.
Signed-off-by: Christian Limpach <Christian.Limpach@cl.cam.ac.uk>
author cl349@firebug.cl.cam.ac.uk
date Wed Jul 27 18:31:18 2005 +0000 (2005-07-27)
parents 06c5924b0c2e
children 72ec508ccbdc
files tools/python/xen/xend/XendDomain.py tools/python/xen/xend/XendDomainInfo.py
line diff
     1.1 --- a/tools/python/xen/xend/XendDomain.py	Wed Jul 27 18:31:03 2005 +0000
     1.2 +++ b/tools/python/xen/xend/XendDomain.py	Wed Jul 27 18:31:18 2005 +0000
     1.3 @@ -55,10 +55,6 @@ class XendDomain:
     1.4          eserver.subscribe('xend.virq', self.onVirq)
     1.5          self.initial_refresh()
     1.6  
     1.7 -        dom0 = self.domain_lookup(0)
     1.8 -        if not dom0:
     1.9 -            dom0 = self.domain_unknown(0)
    1.10 -
    1.11      def list(self):
    1.12          """Get list of domain objects.
    1.13  
    1.14 @@ -117,6 +113,11 @@ class XendDomain:
    1.15                  self._delete_domain(domid)
    1.16          self.refresh(cleanup=True)
    1.17  
    1.18 +        dom0 = self.domain_lookup(0)
    1.19 +        if not dom0:
    1.20 +            dom0 = self.domain_unknown(0)
    1.21 +        dom0.dom0_init_store()    
    1.22 +
    1.23      def close(self):
    1.24          pass
    1.25  
     2.1 --- a/tools/python/xen/xend/XendDomainInfo.py	Wed Jul 27 18:31:03 2005 +0000
     2.2 +++ b/tools/python/xen/xend/XendDomainInfo.py	Wed Jul 27 18:31:18 2005 +0000
     2.3 @@ -164,13 +164,13 @@ class XendDomainInfo:
     2.4          """
     2.5          dom = info['dom']
     2.6          vm = cls(db)
     2.7 +        vm.setdom(dom)
     2.8          db.readDB()
     2.9          vm.importFromDB()
    2.10          config = vm.config
    2.11          log.debug('info=' + str(info))
    2.12          log.debug('config=' + prettyprintstring(config))
    2.13  
    2.14 -        vm.setdom(dom)
    2.15          vm.memory = info['mem_kb']/1024
    2.16  
    2.17          if config:
    2.18 @@ -283,6 +283,7 @@ class XendDomainInfo:
    2.19  
    2.20      def importFromDB(self):
    2.21          self.db.importFromDB(self, fields=self.__exports__)
    2.22 +        self.store_channel = self.eventChannel("store_channel")
    2.23  
    2.24      def setdom(self, dom):
    2.25          """Set the domain id.
    2.26 @@ -983,6 +984,18 @@ class XendDomainInfo:
    2.27              return 0
    2.28          return timeout - (time.time() - self.shutdown_pending['start'])
    2.29  
    2.30 +    def dom0_init_store(self):
    2.31 +        if not self.store_channel:
    2.32 +            self.store_channel = self.eventChannel("store_channel")
    2.33 +        self.store_mfn = xc.init_store(self.store_channel.port2)
    2.34 +        if self.store_mfn >= 0:
    2.35 +            try:
    2.36 +                self.db.introduceDomain(self.id, self.store_mfn,
    2.37 +                                        self.store_channel)
    2.38 +            except:
    2.39 +                pass
    2.40 +        self.exportToDB(save=True, sync=True)
    2.41 +
    2.42  def vm_field_ignore(vm, config, val, index):
    2.43      """Dummy config field handler used for fields with built-in handling.
    2.44