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

[Xen-changelog] A number of changes to get save-restore working again:



# HG changeset patch
# User emellor@ewan
# Node ID eba5afe9aa37d3cb96c22cd93b8b7ec7c8e3e1ca
# Parent  4cff74aa624664beeed306a199200ddfbcb51f95
A number of changes to get save-restore working again:

Fix the use of configuration inside domain_configure.  The config written by
XendDomainInfo.sxpr has moved, and this function needs to change to match.

Re-add a call to _add_domain inside domain_restore.

Inside XendDomainInfo.restore, perform the appropriate configuration to restore
the domain.

Validate maxmem_KiB, and cap it at memory_KiB if over that value.  Save
requires that value to be correct, as the logic for saving only the pages
in use is not in place inside Xen.

Output the device configuration in sxpr(), as required for save-restore.

Check for image being null when trying to call createDeviceModel -- configure
is called on restore as well as create, and the ImageHandler instance is not
present in the former.

Remove dead code create_blkif.

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

diff -r 4cff74aa6246 -r eba5afe9aa37 tools/python/xen/xend/XendDomain.py
--- a/tools/python/xen/xend/XendDomain.py       Thu Sep 22 13:01:01 2005
+++ b/tools/python/xen/xend/XendDomain.py       Thu Sep 22 15:05:44 2005
@@ -299,13 +299,12 @@
                            [dominfo.getName(), dominfo.getDomain(), "fail"])
         return dominfo
 
-    def domain_configure(self, vmconfig):
+    def domain_configure(self, config):
         """Configure an existing domain. This is intended for internal
         use by domain restore and migrate.
 
         @param vmconfig: vm configuration
         """
-        config = sxp.child_value(vmconfig, 'config')
         return XendDomainInfo.restore(self.dbmap.getPath(), config)
 
     def domain_restore(self, src, progress=False):
@@ -317,7 +316,9 @@
 
         try:
             fd = os.open(src, os.O_RDONLY)
-            return XendCheckpoint.restore(self, fd)
+            dominfo = XendCheckpoint.restore(self, fd)
+            self._add_domain(dominfo)
+            return dominfo
         except OSError, ex:
             raise XendError("can't read guest state file %s: %s" %
                             (src, ex[1]))
@@ -502,7 +503,7 @@
         """
 
         if domid == PRIV_DOMAIN:
-            raise XendError("Cannot destroy priviliged domain %i" % domid)
+            raise XendError("Cannot destroy privileged domain %i" % domid)
         
         self.domain_restart_schedule(domid, reason, force=True)
         dominfo = self.domain_lookup(domid)
diff -r 4cff74aa6246 -r eba5afe9aa37 tools/python/xen/xend/XendDomainInfo.py
--- a/tools/python/xen/xend/XendDomainInfo.py   Thu Sep 22 13:01:01 2005
+++ b/tools/python/xen/xend/XendDomainInfo.py   Thu Sep 22 15:05:44 2005
@@ -172,7 +172,7 @@
         @param uuid:      uuid to use
         """
         
-        log.debug("XendDomainInfo.restore(%s, ..., %s)", dompath, uuid)
+        log.debug("XendDomainInfo.restore(%s, %s, %s)", dompath, config, uuid)
 
         if not uuid:
             uuid = getUuid()
@@ -187,6 +187,9 @@
         vm = cls(uuid, dompath, cls.parseConfig(config),
                  xc.domain_create(ssidref = ssidref))
         vm.clear_shutdown()
+        vm.create_channel()
+        vm.configure()
+        vm.exportToDB()
         return vm
 
     restore = classmethod(restore)
@@ -382,6 +385,9 @@
             if not self.info['maxmem_KiB']:
                 self.info['maxmem_KiB'] = 1 << 30
 
+            if self.info['maxmem_KiB'] > self.info['memory_KiB']:
+                self.info['maxmem_KiB'] = self.info['memory_KiB']
+
             # Validate the given backend names.
             for s in self.info['backend']:
                 if s not in backendFlags:
@@ -606,6 +612,10 @@
             sxpr.append(['uuid', self.uuid])
         if self.info:
             sxpr.append(['maxmem', self.info['maxmem_KiB'] / 1024])
+
+            if self.infoIsSet('device'):
+                for (n, c) in self.info['device']:
+                    sxpr.append(['device', c])
 
             def stateChar(name):
                 if name in self.info:
@@ -864,7 +874,8 @@
         """
         if not self.rebooting():
             self.create_configured_devices()
-        self.image.createDeviceModel()
+        if self.image:
+            self.image.createDeviceModel()
 
     def device_create(self, dev_config):
         """Create a new device.
@@ -979,15 +990,6 @@
         """
         self.configure_maxmem()
         self.create_devices()
-        self.create_blkif()
-
-    def create_blkif(self):
-        """Create the block device interface (blkif) for the vm.
-        The vm needs a blkif even if it doesn't have any disks
-        at creation time, for example when it uses NFS root.
-
-        """
-        return
 
 
     def configure_maxmem(self):

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