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] [xen-unstable] xend: Restore values of /vm/uuid/xend/* t

To: xen-changelog@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-changelog] [xen-unstable] xend: Restore values of /vm/uuid/xend/* to recreated domains.
From: Xen patchbot-unstable <patchbot-unstable@xxxxxxxxxxxxxxxxxxx>
Date: Tue, 05 Feb 2008 11:10:22 -0800
Delivery-date: Tue, 05 Feb 2008 11:10:19 -0800
Envelope-to: www-data@xxxxxxxxxxxxxxxxxx
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 Keir Fraser <keir.fraser@xxxxxxxxxx>
# Date 1202207975 0
# Node ID def2adbce510a31711f22cf15f5afe51f875e3ea
# Parent  32e9c52fc6d9a6104afb2dbd84a89395b16f0e34
xend: Restore values of /vm/uuid/xend/* to recreated domains.

When guest domains are restarted, previous values of /vm/uuid/xend/*
in xenstore are lost.  (e.g. previous_restart_time,
last_shutdown_reason). This patch restores them to restarting domains.
And we should update /vm/uuid/xend/restart_count of restarting
domains, not previous domains.

Signed-off-by: Masaki Kanno <kanno.masaki@xxxxxxxxxxxxxx>
---
 tools/python/xen/xend/XendDomainInfo.py |   12 +++++++++---
 1 files changed, 9 insertions(+), 3 deletions(-)

diff -r 32e9c52fc6d9 -r def2adbce510 tools/python/xen/xend/XendDomainInfo.py
--- a/tools/python/xen/xend/XendDomainInfo.py   Tue Feb 05 10:29:19 2008 +0000
+++ b/tools/python/xen/xend/XendDomainInfo.py   Tue Feb 05 10:39:35 2008 +0000
@@ -879,6 +879,9 @@ class XendDomainInfo:
     def _gatherVm(self, *args):
         return xstransact.Gather(self.vmpath, *args)
 
+    def _listRecursiveVm(self, *args):
+        return xstransact.ListRecursive(self.vmpath, *args)
+
     def storeVm(self, *args):
         return xstransact.Store(self.vmpath, *args)
 
@@ -1393,6 +1396,7 @@ class XendDomainInfo:
 
         self._writeVm('xend/previous_restart_time', str(now))
 
+        prev_vm_xend = self._listRecursiveVm('xend')
         new_dom_info = self.info
         try:
             if rename:
@@ -1411,8 +1415,13 @@ class XendDomainInfo:
             try:
                 new_dom = XendDomain.instance().domain_create_from_dict(
                     new_dom_info)
+                for x in prev_vm_xend[0][1]:
+                    new_dom._writeVm('xend/%s' % x[0], x[1])
                 new_dom.waitForDevices()
                 new_dom.unpause()
+                rst_cnt = new_dom._readVm('xend/restart_count')
+                rst_cnt = int(rst_cnt) + 1
+                new_dom._writeVm('xend/restart_count', str(rst_cnt))
                 new_dom._removeVm(RESTART_IN_PROGRESS)
             except:
                 if new_dom:
@@ -1448,9 +1457,6 @@ class XendDomainInfo:
         self.vmpath = XS_VMROOT + new_uuid
         # Write out new vm node to xenstore
         self._storeVmDetails()
-        rst_cnt = self._readVm('xend/restart_count')
-        rst_cnt = int(rst_cnt) + 1
-        self._writeVm('xend/restart_count', str(rst_cnt))
         self._preserve()
         return new_dom_info
 

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

<Prev in Thread] Current Thread [Next in Thread>
  • [Xen-changelog] [xen-unstable] xend: Restore values of /vm/uuid/xend/* to recreated domains., Xen patchbot-unstable <=