WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-changelog

[Xen-changelog] [xen-unstable] [XEND] Improve xm pause/unpause error rep

To: xen-changelog@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-changelog] [xen-unstable] [XEND] Improve xm pause/unpause error reporting.
From: Xen patchbot-unstable <patchbot-unstable@xxxxxxxxxxxxxxxxxxx>
Date: Wed, 12 Jul 2006 16:50:17 +0000
Delivery-date: Wed, 12 Jul 2006 09:52:38 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxx
List-help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-id: BK change log <xen-changelog.lists.xensource.com>
List-post: <mailto:xen-changelog@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-changelog>, <mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-changelog>, <mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
Reply-to: xen-devel@xxxxxxxxxxxxxxxxxxx
Sender: xen-changelog-bounces@xxxxxxxxxxxxxxxxxxx
# 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

<Prev in Thread] Current Thread [Next in Thread>
  • [Xen-changelog] [xen-unstable] [XEND] Improve xm pause/unpause error reporting., Xen patchbot-unstable <=