[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [Xen-changelog] [xen-unstable] [XEND] Improve xm pause/unpause error reporting.
# HG changeset patch # User kfraser@xxxxxxxxxxxxxxxxxxxxx # Node ID 9ddc5be227c19f52b44f3cdc84383568a2b42c2a # Parent 800261a88275baa3f031aaeb9d847e1d2b20ebd3 [XEND] Improve xm pause/unpause error reporting. Signed-off-by: Masaki Kanno <kanno.masaki@xxxxxxxxxxxxxx> --- tools/python/xen/xend/XendDomain.py | 26 ++++++++++++++++++-------- 1 files changed, 18 insertions(+), 8 deletions(-) diff -r 800261a88275 -r 9ddc5be227c1 tools/python/xen/xend/XendDomain.py --- a/tools/python/xen/xend/XendDomain.py Mon Jul 10 15:10:00 2006 +0100 +++ b/tools/python/xen/xend/XendDomain.py Mon Jul 10 15:18:12 2006 +0100 @@ -370,10 +370,15 @@ class XendDomain: def domain_unpause(self, domid): """Unpause domain execution.""" - try: - dominfo = self.domain_lookup_by_name_or_id_nr(domid) - if not dominfo: - raise XendInvalidDomain(str(domid)) + + dominfo = self.domain_lookup_by_name_or_id_nr(domid) + if not dominfo: + raise XendInvalidDomain(str(domid)) + + if dominfo.getDomid() == PRIV_DOMAIN: + raise XendError("Cannot unpause privileged domain %s" % domid) + + try: log.info("Domain %s (%d) unpaused.", dominfo.getName(), dominfo.getDomid()) return dominfo.unpause() @@ -383,10 +388,15 @@ class XendDomain: def domain_pause(self, domid): """Pause domain execution.""" - try: - dominfo = self.domain_lookup_by_name_or_id_nr(domid) - if not dominfo: - raise XendInvalidDomain(str(domid)) + + dominfo = self.domain_lookup_by_name_or_id_nr(domid) + if not dominfo: + raise XendInvalidDomain(str(domid)) + + if dominfo.getDomid() == PRIV_DOMAIN: + raise XendError("Cannot pause privileged domain %s" % domid) + + try: log.info("Domain %s (%d) paused.", dominfo.getName(), dominfo.getDomid()) return dominfo.pause() _______________________________________________ Xen-changelog mailing list Xen-changelog@xxxxxxxxxxxxxxxxxxx http://lists.xensource.com/xen-changelog
|
Lists.xenproject.org is hosted with RackSpace, monitoring our |