[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [Xen-changelog] Rearrange restart logic so that a failure to restart a domain does not cause
# HG changeset patch # User emellor@xxxxxxxxxxxxxxxxxxxxxx # Node ID eafd932231ae1316a7ed7b0a1655543bed050180 # Parent f2202af6402347387ea2ee10d03742bcb67cefd5 Rearrange restart logic so that a failure to restart a domain does not cause cascading secondary errors. Fixes bug #384. Signed-off-by: Ewan Mellor <ewan@xxxxxxxxxxxxx> diff -r f2202af64023 -r eafd932231ae tools/python/xen/xend/XendDomainInfo.py --- a/tools/python/xen/xend/XendDomainInfo.py Tue Nov 8 01:51:34 2005 +++ b/tools/python/xen/xend/XendDomainInfo.py Tue Nov 8 02:07:57 2005 @@ -89,6 +89,8 @@ """Minimum time between domain restarts in seconds.""" MINIMUM_RESTART_TIME = 20 + +RESTART_IN_PROGRESS = 'xend/restart_in_progress' xc = xen.lowlevel.xc.new() @@ -1269,14 +1271,14 @@ config = self.sxpr() - if self.readVm('xend/restart_in_progress'): + if self.readVm(RESTART_IN_PROGRESS): log.error('Xend failed during restart of domain %d. ' 'Refusing to restart to avoid loops.', self.domid) self.destroy() return - self.writeVm('xend/restart_in_progress', 'True') + self.writeVm(RESTART_IN_PROGRESS, 'True') now = time.time() rst = self.readVm('xend/previous_restart_time') @@ -1298,26 +1300,28 @@ self.preserveForRestart() else: self.destroyDomain() - + + # new_dom's VM will be the same as this domain's VM, except where + # the rename flag has instructed us to call preserveForRestart. + # In that case, it is important that we remove the + # RESTART_IN_PROGRESS node from the new domain, not the old one, + # once the new one is available. + + new_dom = None try: xd = get_component('xen.xend.XendDomain') new_dom = xd.domain_create(config) - try: - new_dom.unpause() - except: + new_dom.unpause() + new_dom.removeVm(RESTART_IN_PROGRESS) + except: + if new_dom: + new_dom.removeVm(RESTART_IN_PROGRESS) new_dom.destroy() - raise - except: - log.exception('Failed to restart domain %d.', self.domid) - finally: - # new_dom's VM will be the same as this domain's VM, except where - # the rename flag has instructed us to call preserveForRestart. - # In that case, it is important that we use new_dom.removeVm, not - # self.removeVm. - new_dom.removeVm('xend/restart_in_progress') - - # self.configure_bootloader() - # self.exportToDB() + else: + self.removeVm(RESTART_IN_PROGRESS) + raise + except: + log.exception('Failed to restart domain %d.', self.domid) def preserveForRestart(self): _______________________________________________ Xen-changelog mailing list Xen-changelog@xxxxxxxxxxxxxxxxxxx http://lists.xensource.com/xen-changelog
|
Lists.xenproject.org is hosted with RackSpace, monitoring our |