xend: Fix cleanup_domains() for suspending managed domains

When unmanaged domains with on_xend_stop="suspend" exist, managed
domains are not suspended by xend stop command.  The processing of
cleanup_domains() is aborted by exception. This patch keeps suspending
managed domains even if unmanaged domains exist.

Signed-off-by: Masaki Kanno <kanno.masaki@jp.fujitsu.com>
This commit is contained in:
Keir Fraser committed 2007-12-12 10:08:14 +00:00
1 parent c3711577c1
commit 1a0a31cbc6
1 file changed
+13 -7
+13 -7
View File
@@ -613,13 +613,19 @@ class XendDomain:
if dom.getName() == DOM0_NAME:
continue
if dom._stateGet() == DOM_STATE_RUNNING:
shutdownAction = dom.info.get('on_xend_stop', 'ignore')
if shutdownAction == 'shutdown':
log.debug('Shutting down domain: %s' % dom.getName())
dom.shutdown("poweroff")
elif shutdownAction == 'suspend':
self.domain_suspend(dom.getName())
try:
if dom._stateGet() == DOM_STATE_RUNNING:
shutdownAction = dom.info.get('on_xend_stop', 'ignore')
if shutdownAction == 'shutdown':
log.debug('Shutting down domain: %s' % dom.getName())
dom.shutdown("poweroff")
elif shutdownAction == 'suspend':
self.domain_suspend(dom.getName())
else:
log.debug('Domain %s continues to run.' % dom.getName())
except:
log.exception('Domain %s failed to %s.' % \
(dom.getName(), shutdownAction))
finally:
self.domains_lock.release()
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.