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] Cleanup HVM image shutdown watch a

To: xen-changelog@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-changelog] [xen-unstable] [XEND] Cleanup HVM image shutdown watch and move readDom call away
From: Xen patchbot-unstable <patchbot-unstable@xxxxxxxxxxxxxxxxxxx>
Date: Mon, 06 Nov 2006 16:50:28 +0000
Delivery-date: Mon, 06 Nov 2006 08:52:51 -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 Alastair Tse <atse@xxxxxxxxxxxxx>
# Node ID 3a0116aa7ff56573342078e8123bd7398b61755b
# Parent  b5c50a603044be3b2cd5081ac0a8a7c109469640
[XEND] Cleanup HVM image shutdown watch and move readDom call away
from image.py

Signed-off-by: Alastair Tse <atse@xxxxxxxxxxxxx>
---
 tools/python/xen/xend/XendDomainInfo.py |    3 ++-
 tools/python/xen/xend/image.py          |   12 ++++++++----
 2 files changed, 10 insertions(+), 5 deletions(-)

diff -r b5c50a603044 -r 3a0116aa7ff5 tools/python/xen/xend/XendDomainInfo.py
--- a/tools/python/xen/xend/XendDomainInfo.py   Fri Nov 03 15:17:00 2006 +0000
+++ b/tools/python/xen/xend/XendDomainInfo.py   Fri Nov 03 15:47:05 2006 +0000
@@ -797,11 +797,12 @@ class XendDomainInfo:
     def getDomainPath(self):
         return self.dompath
 
+    def getShutdownReason(self):
+        return self._readDom('control/shutdown')
 
     def getStorePort(self):
         """For use only by image.py and XendCheckpoint.py."""
         return self.store_port
-
 
     def getConsolePort(self):
         """For use only by image.py and XendCheckpoint.py"""
diff -r b5c50a603044 -r 3a0116aa7ff5 tools/python/xen/xend/image.py
--- a/tools/python/xen/xend/image.py    Fri Nov 03 15:17:00 2006 +0000
+++ b/tools/python/xen/xend/image.py    Fri Nov 03 15:47:05 2006 +0000
@@ -24,7 +24,7 @@ import signal
 
 import xen.lowlevel.xc
 from xen.xend import sxp
-from xen.xend.XendError import VmError
+from xen.xend.XendError import VmError, XendError
 from xen.xend.XendLogging import log
 from xen.xend.server.netif import randomMAC
 from xen.xend.xenstore.xswatch import xswatch
@@ -456,9 +456,13 @@ class HVMImageHandler(ImageHandler):
         """
         from xen.xend.XendConstants import DOMAIN_SHUTDOWN_REASONS
         xd = xen.xend.XendDomain.instance()
-        vm = xd.domain_lookup( self.vm.getDomid() )
-
-        reason = vm._readDom('control/shutdown')
+        try:
+            vm = xd.domain_lookup( self.vm.getDomid() )
+        except XendError:
+            # domain isn't registered, no need to clean it up.
+            return
+
+        reason = vm.getShutdownReason()
         log.debug("hvm_shutdown fired, shutdown reason=%s", reason)
         for x in DOMAIN_SHUTDOWN_REASONS.keys():
             if DOMAIN_SHUTDOWN_REASONS[x] == reason:

_______________________________________________
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] Cleanup HVM image shutdown watch and move readDom call away, Xen patchbot-unstable <=