ia64/xen-unstable

changeset 7554:f994ee35da23

Fix reboot logic. An indentation error meant that every second reboot would
be refused, with the domain being destroyed instead.

Further fix for reboot logic when using on_reboot=rename-restart: the incorrect
node was being removed once restart has completed, leaving Xend to conclude
later that it had crashed in the middle of a restart.

Signed-off-by: Ewan Mellor <ewan@xensource.com>
author emellor@leeni.uk.xensource.com
date Fri Oct 28 13:02:06 2005 +0100 (2005-10-28)
parents e70ea9465b31
children 889afaf6ca25
files tools/python/xen/xend/XendDomainInfo.py
line diff
     1.1 --- a/tools/python/xen/xend/XendDomainInfo.py	Thu Oct 27 10:53:02 2005 +0100
     1.2 +++ b/tools/python/xen/xend/XendDomainInfo.py	Fri Oct 28 13:02:06 2005 +0100
     1.3 @@ -1275,7 +1275,6 @@ class XendDomainInfo:
     1.4  
     1.5          now = time.time()
     1.6          rst = self.readVm('xend/previous_restart_time')
     1.7 -        log.error(rst)
     1.8          if rst:
     1.9              rst = float(rst)
    1.10              timeout = now - rst
    1.11 @@ -1284,8 +1283,8 @@ class XendDomainInfo:
    1.12                      'VM %s restarting too fast (%f seconds since the last '
    1.13                      'restart).  Refusing to restart to avoid loops.',
    1.14                      self.info['name'], timeout)
    1.15 -            self.destroy()
    1.16 -            return
    1.17 +                self.destroy()
    1.18 +                return
    1.19  
    1.20          self.writeVm('xend/previous_restart_time', str(now))
    1.21  
    1.22 @@ -1306,7 +1305,11 @@ class XendDomainInfo:
    1.23              except:
    1.24                  log.exception('Failed to restart domain %d.', self.domid)
    1.25          finally:
    1.26 -            self.removeVm('xend/restart_in_progress')
    1.27 +            # new_dom's VM will be the same as this domain's VM, except where
    1.28 +            # the rename flag has instructed us to call preserveForRestart.
    1.29 +            # In that case, it is important that we use new_dom.removeVm, not
    1.30 +            # self.removeVm.
    1.31 +            new_dom.removeVm('xend/restart_in_progress')
    1.32              
    1.33          # self.configure_bootloader()
    1.34          #        self.exportToDB()