WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-changelog

[Xen-changelog] Regig the construction of new domains so that restore an

To: xen-changelog@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-changelog] Regig the construction of new domains so that restore and create can share the
From: Xen patchbot -unstable <patchbot-unstable@xxxxxxxxxxxxxxxxxxx>
Date: Fri, 07 Oct 2005 12:46:11 +0000
Delivery-date: Fri, 07 Oct 2005 12:43:44 +0000
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
List-help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-id: BK change log <xen-changelog.lists.xensource.com>
List-post: <mailto:xen-changelog@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-changelog>, <mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-changelog>, <mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
Reply-to: xen-devel@xxxxxxxxxxxxxxxxxxx
Sender: xen-changelog-bounces@xxxxxxxxxxxxxxxxxxx
# HG changeset patch
# User emellor@ewan
# Node ID b5c5360a61d01912ccd71c0d07b03d424024d14f
# Parent  2a3e10a132a2a57795ff9a46e465f99793c31da5
Regig the construction of new domains so that restore and create can share the
construct method.  This ensures that the domain will have any stale paths in
the store removed on restore.

Signed-off-by: Ewan Mellor <ewan@xxxxxxxxxxxxx>

diff -r 2a3e10a132a2 -r b5c5360a61d0 tools/python/xen/xend/XendDomainInfo.py
--- a/tools/python/xen/xend/XendDomainInfo.py   Fri Oct  7 10:16:28 2005
+++ b/tools/python/xen/xend/XendDomainInfo.py   Fri Oct  7 12:34:10 2005
@@ -153,6 +153,11 @@
     vm = XendDomainInfo(getUuid(), parseConfig(config))
     try:
         vm.construct()
+        vm.initDomain()
+        vm.construct_image()
+        vm.configure()
+        vm.storeVmDetails()
+        vm.storeDomDetails()
         vm.refreshShutdown()
         return vm
     except:
@@ -223,19 +228,14 @@
     except TypeError, exn:
         raise VmError('Invalid ssidref in config: %s' % exn)
 
-    domid = xc.domain_create(ssidref = ssidref)
-    if domid < 0:
-        raise VmError('Creating domain failed for restore')
+    vm = XendDomainInfo(uuid, parseConfig(config))
     try:
-        vm = XendDomainInfo(uuid, parseConfig(config), domid)
-    except:
-        xc.domain_destroy(domid)
-        raise
-    try:
-        vm.storeVmDetails()
+        vm.construct()
         vm.configure()
         vm.create_channel()
+        vm.storeVmDetails()
         vm.storeDomDetails()
+        vm.refreshShutdown()
         return vm
     except:
         vm.destroy()
@@ -1001,12 +1001,6 @@
         # shutdown_start_time from killing the domain, for example.
         self.removeDom()
 
-        self.initDomain()
-        self.construct_image()
-        self.configure()
-        self.storeVmDetails()
-        self.storeDomDetails()
-
 
     def initDomain(self):
         log.debug('XendDomainInfo.initDomain: %s %s %s',
@@ -1100,13 +1094,13 @@
     def destroyDomain(self):
         log.debug("XendDomainInfo.destroyDomain(%s)", str(self.domid))
 
-        self.cleanupDomain()
-
         try:
             if self.domid is not None:
                 xc.domain_destroy(dom=self.domid)
         except:
             log.exception("XendDomainInfo.destroy: xc.domain_destroy failed.")
+
+        self.cleanupDomain()
 
 
     ## private:

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

<Prev in Thread] Current Thread [Next in Thread>
  • [Xen-changelog] Regig the construction of new domains so that restore and create can share the, Xen patchbot -unstable <=