mirror of
https://github.com/xen-project/xen.git
synced 2026-10-29 18:50:05 +01:00
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:
1 parent
c3711577c1
commit
1a0a31cbc6
1 file changed
+13
-7
@@ -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()
|
||||
|
||||
|
||||