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

[Xen-changelog] [xen-unstable] Fix 'on_*=rename-restart' domain configuration option.



# HG changeset patch
# User Keir Fraser <keir.fraser@xxxxxxxxxx>
# Date 1201267747 0
# Node ID 367902a19412ba2cb6b3dff88a83ba624457e8e0
# Parent  666573856c5928371435b72d907dd7f06965965f
Fix 'on_*=rename-restart' domain configuration option.

When setting e.g. 'on_crash=rename-restart' option in domain config
and crashing guest OS running in the domain, the new domain is
restarted with same name as renamed domain.

jfehlig4: # xm li
Name                                        ID   Mem VCPUs State Time(s)
Domain-0                                     0   1233   4  r----- 937.9
Domain-e64b12a0-0493-44d7-afde-55c776513426 21   384    1  ---c-  14.3
Domain-e64b12a0-0493-44d7-afde-55c776513426 22   384    1  r-----  7.3

This patch copies the domain info prior to setting new name and uuid
in the crashed domain info and uses the copied domain info to
construct the restarted domain.

Signed-off-by: Jim Fehlig <jfehlig@xxxxxxxxxx>
---
 tools/python/xen/xend/XendDomainInfo.py |    9 +++++++--
 1 files changed, 7 insertions(+), 2 deletions(-)

diff -r 666573856c59 -r 367902a19412 tools/python/xen/xend/XendDomainInfo.py
--- a/tools/python/xen/xend/XendDomainInfo.py   Fri Jan 25 13:28:25 2008 +0000
+++ b/tools/python/xen/xend/XendDomainInfo.py   Fri Jan 25 13:29:07 2008 +0000
@@ -1393,9 +1393,10 @@ class XendDomainInfo:
 
         self._writeVm('xend/previous_restart_time', str(now))
 
+        new_dom_info = self.info
         try:
             if rename:
-                self._preserveForRestart()
+                new_dom_info = self._preserveForRestart()
             else:
                 self._unwatchVm()
                 self.destroyDomain()
@@ -1409,7 +1410,7 @@ class XendDomainInfo:
             new_dom = None
             try:
                 new_dom = XendDomain.instance().domain_create_from_dict(
-                    self.info)
+                    new_dom_info)
                 new_dom.waitForDevices()
                 new_dom.unpause()
                 rst_cnt = self._readVm('xend/restart_count')
@@ -1440,11 +1441,15 @@ class XendDomainInfo:
                  new_name, new_uuid)
         self._unwatchVm()
         self._releaseDevices()
+        new_dom_info = self.info.copy()
+        new_dom_info['name_label'] = self.info['name_label']
+        new_dom_info['uuid'] = self.info['uuid']
         self.info['name_label'] = new_name
         self.info['uuid'] = new_uuid
         self.vmpath = XS_VMROOT + new_uuid
         self._storeVmDetails()
         self._preserve()
+        return new_dom_info
 
 
     def _preserve(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®.