aboutsummaryrefslogtreecommitdiffstats
path: root/tools
diff options
context:
space:
mode:
authorkfraser@localhost.localdomain <kfraser@localhost.localdomain>2007-07-09 09:38:35 +0100
committerkfraser@localhost.localdomain <kfraser@localhost.localdomain>2007-07-09 09:38:35 +0100
commitddc75a75d969256727b3b6c00e71f16516f498a4 (patch)
tree80e10580a40ba6e3886a415131b49356ccba8284 /tools
parent38e46984b66243cca9dd98338b5e09ef4d1899ca (diff)
downloadxen-ddc75a75d969256727b3b6c00e71f16516f498a4.tar.gz
xen-ddc75a75d969256727b3b6c00e71f16516f498a4.tar.bz2
xen-ddc75a75d969256727b3b6c00e71f16516f498a4.zip
Better error message for 'xm sysrq' on inactive domain.
Signed-off-by: Masaki Kanno <kanno.masaki@jp.fujitsu.com>
Diffstat (limited to 'tools')
-rw-r--r--tools/python/xen/xend/XendDomainInfo.py3
1 files changed, 3 insertions, 0 deletions
diff --git a/tools/python/xen/xend/XendDomainInfo.py b/tools/python/xen/xend/XendDomainInfo.py
index a142d07301..9cb85e8ffc 100644
--- a/tools/python/xen/xend/XendDomainInfo.py
+++ b/tools/python/xen/xend/XendDomainInfo.py
@@ -488,6 +488,9 @@ class XendDomainInfo:
def send_sysrq(self, key):
""" Send a Sysrq equivalent key via xenstored."""
+ if self._stateGet() not in (DOM_STATE_RUNNING, DOM_STATE_PAUSED):
+ raise XendError("Domain '%s' is not started" % self.info['name_label'])
+
asserts.isCharConvertible(key)
self.storeDom("control/sysrq", '%c' % key)