[XEND] Cleanup HVM image shutdown watch and move readDom call away

from image.py

Signed-off-by: Alastair Tse <atse@xensource.com>
This commit is contained in:
Alastair Tse committed 2006-11-03 15:47:05 +00:00
1 parent 5061e2c063
commit 2791eeb645
2 files changed
+9 -4

No files matched your search

+2 -1
View File
@@ -797,12 +797,13 @@ 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"""
return self.console_port
+7 -3
View File
@@ -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() )
try:
vm = xd.domain_lookup( self.vm.getDomid() )
except XendError:
# domain isn't registered, no need to clean it up.
return
reason = vm._readDom('control/shutdown')
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:
Reference in new issue
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.