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

[Xen-changelog] Move variable initialisation out of import section. Remove obsolete save



# HG changeset patch
# User emellor@ewan
# Node ID 2f83ff9f6bd2a7987c297b84bfce1f8e22409cae
# Parent  40a0f049e344e7704d24c669e65d07dc87c6efc8
Move variable initialisation out of import section.  Remove obsolete save
parameter from XendDominInfo.exportToDB.

diff -r 40a0f049e344 -r 2f83ff9f6bd2 tools/python/xen/xend/XendDomain.py
--- a/tools/python/xen/xend/XendDomain.py       Thu Sep 22 16:58:43 2005
+++ b/tools/python/xen/xend/XendDomain.py       Thu Sep 22 17:03:16 2005
@@ -23,13 +23,13 @@
 """
 import os
 
-import xen.lowlevel.xc; xc = xen.lowlevel.xc.new()
+import xen.lowlevel.xc
 
 from xen.xend import sxp
-from xen.xend import XendRoot; xroot = XendRoot.instance()
+from xen.xend import XendRoot
 from xen.xend import XendCheckpoint
 from xen.xend.XendDomainInfo import XendDomainInfo, shutdown_reason
-from xen.xend import EventServer; eserver = EventServer.instance()
+from xen.xend import EventServer
 from xen.xend.XendError import XendError
 from xen.xend.XendLogging import log
 from xen.xend import scheduler
@@ -38,6 +38,12 @@
 from xen.xend.xenstore import XenNode, DBMap
 from xen.xend.xenstore.xstransact import xstransact
 from xen.xend.xenstore.xsutil import GetDomainPath
+
+
+xc = xen.lowlevel.xc.new()
+xroot = XendRoot.instance()
+eserver = EventServer.instance()
+
 
 __all__ = [ "XendDomain" ]
 
@@ -182,7 +188,7 @@
         if info.getDomid() in self.domains:
             notify = False
         self.domains[info.getDomid()] = info
-        info.exportToDB(save=True)
+        info.exportToDB()
         if notify:
             eserver.inject('xend.domain.create', [info.getName(),
                                                   info.getDomid()])
diff -r 40a0f049e344 -r 2f83ff9f6bd2 tools/python/xen/xend/XendDomainInfo.py
--- a/tools/python/xen/xend/XendDomainInfo.py   Thu Sep 22 16:58:43 2005
+++ b/tools/python/xen/xend/XendDomainInfo.py   Thu Sep 22 17:03:16 2005
@@ -444,7 +444,7 @@
         return xstransact.Store(self.path, *args)
 
 
-    def exportToDB(self, save=False):
+    def exportToDB(self):
         to_store = {
             'domid':              str(self.domid),
             'uuid':               self.uuid,
@@ -718,7 +718,7 @@
             # Create domain devices.
             self.construct_image()
             self.configure()
-            self.exportToDB(save=True)
+            self.exportToDB()
         except Exception, ex:
             # Catch errors, cleanup and re-raise.
             print 'Domain construction error:', ex
@@ -739,7 +739,7 @@
                                       ssidref = self.info['ssidref'])
         if self.domid <= 0:
             raise VmError('Creating domain failed: name=%s' %
-                          self.vm.getName())
+                          self.info['name'])
 
         if self.info['bootloader']:
             self.image.handleBootloading()

_______________________________________________
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®.