[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Xen-changelog] Introduce dom0 to the store.



# HG changeset patch
# User cl349@xxxxxxxxxxxxxxxxxxxx
# Node ID f24fcd22c68f5b8a8835abbab4c84ba68fb8159a
# Parent  06c5924b0c2ed0ca144e6e9408c6fc85d30b1339
Introduce dom0 to the store.
Signed-off-by: Christian Limpach <Christian.Limpach@xxxxxxxxxxxx>

diff -r 06c5924b0c2e -r f24fcd22c68f tools/python/xen/xend/XendDomain.py
--- a/tools/python/xen/xend/XendDomain.py       Wed Jul 27 18:31:03 2005
+++ b/tools/python/xen/xend/XendDomain.py       Wed Jul 27 18:31:18 2005
@@ -54,10 +54,6 @@
         self.dbmap = DBMap(db=XenNode("/domain"))
         eserver.subscribe('xend.virq', self.onVirq)
         self.initial_refresh()
-
-        dom0 = self.domain_lookup(0)
-        if not dom0:
-            dom0 = self.domain_unknown(0)
 
     def list(self):
         """Get list of domain objects.
@@ -116,6 +112,11 @@
             else:
                 self._delete_domain(domid)
         self.refresh(cleanup=True)
+
+        dom0 = self.domain_lookup(0)
+        if not dom0:
+            dom0 = self.domain_unknown(0)
+        dom0.dom0_init_store()    
 
     def close(self):
         pass
diff -r 06c5924b0c2e -r f24fcd22c68f tools/python/xen/xend/XendDomainInfo.py
--- a/tools/python/xen/xend/XendDomainInfo.py   Wed Jul 27 18:31:03 2005
+++ b/tools/python/xen/xend/XendDomainInfo.py   Wed Jul 27 18:31:18 2005
@@ -164,13 +164,13 @@
         """
         dom = info['dom']
         vm = cls(db)
+        vm.setdom(dom)
         db.readDB()
         vm.importFromDB()
         config = vm.config
         log.debug('info=' + str(info))
         log.debug('config=' + prettyprintstring(config))
 
-        vm.setdom(dom)
         vm.memory = info['mem_kb']/1024
 
         if config:
@@ -283,6 +283,7 @@
 
     def importFromDB(self):
         self.db.importFromDB(self, fields=self.__exports__)
+        self.store_channel = self.eventChannel("store_channel")
 
     def setdom(self, dom):
         """Set the domain id.
@@ -983,6 +984,18 @@
             return 0
         return timeout - (time.time() - self.shutdown_pending['start'])
 
+    def dom0_init_store(self):
+        if not self.store_channel:
+            self.store_channel = self.eventChannel("store_channel")
+        self.store_mfn = xc.init_store(self.store_channel.port2)
+        if self.store_mfn >= 0:
+            try:
+                self.db.introduceDomain(self.id, self.store_mfn,
+                                        self.store_channel)
+            except:
+                pass
+        self.exportToDB(save=True, sync=True)
+
 def vm_field_ignore(vm, config, val, index):
     """Dummy config field handler used for fields with built-in handling.
 

_______________________________________________
Xen-changelog mailing list
Xen-changelog@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-changelog


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.