ia64/xen-unstable

changeset 13278:5f86325c62f6

Record the last shutdown reason for each VM in the store.

Signed-off-by: Ewan Mellor <ewan@xensource.com>
author Ewan Mellor <ewan@xensource.com>
date Fri Jan 05 15:38:01 2007 +0000 (2007-01-05)
parents efbfcc3b9f38
children 8fd5113abb2e
files tools/python/xen/xend/XendConstants.py tools/python/xen/xend/XendDomainInfo.py
line diff
     1.1 --- a/tools/python/xen/xend/XendConstants.py	Fri Jan 05 15:34:47 2007 +0000
     1.2 +++ b/tools/python/xen/xend/XendConstants.py	Fri Jan 05 15:38:01 2007 +0000
     1.3 @@ -80,6 +80,7 @@ ZOMBIE_PREFIX = 'Zombie-'
     1.4  MINIMUM_RESTART_TIME = 20
     1.5  
     1.6  RESTART_IN_PROGRESS = 'xend/restart_in_progress'
     1.7 +LAST_SHUTDOWN_REASON = 'xend/last_shutdown_reason'
     1.8  
     1.9  #
    1.10  # Device migration stages (eg. XendDomainInfo, XendCheckpoint, server.tpmif)
     2.1 --- a/tools/python/xen/xend/XendDomainInfo.py	Fri Jan 05 15:34:47 2007 +0000
     2.2 +++ b/tools/python/xen/xend/XendDomainInfo.py	Fri Jan 05 15:38:01 2007 +0000
     2.3 @@ -969,6 +969,7 @@ class XendDomainInfo:
     2.4  
     2.5                  log.warn('Domain has crashed: name=%s id=%d.',
     2.6                           self.info['name_label'], self.domid)
     2.7 +                self._writeVm(LAST_SHUTDOWN_REASON, 'crash')
     2.8  
     2.9                  if xroot.get_enable_dump():
    2.10                      self.dumpCore()
    2.11 @@ -988,6 +989,7 @@ class XendDomainInfo:
    2.12  
    2.13                      log.info('Domain has shutdown: name=%s id=%d reason=%s.',
    2.14                               self.info['name_label'], self.domid, reason)
    2.15 +                    self._writeVm(LAST_SHUTDOWN_REASON, reason)
    2.16  
    2.17                      self._clearRestart()
    2.18