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] Fix xm dump-core command for paused domai

To: xen-changelog@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-changelog] [xen-unstable] Fix xm dump-core command for paused domain.
From: Xen patchbot-unstable <patchbot-unstable@xxxxxxxxxxxxxxxxxxx>
Date: Wed, 26 Sep 2007 03:40:16 -0700
Delivery-date: Wed, 26 Sep 2007 03:41:07 -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
# Date 1189782438 -3600
# Node ID 9a7cbde124a500e8ac5f713fb282fa6e76b06db2
# Parent  9f4f7023304176283faf8edc6a3d4260e5a99763
Fix xm dump-core command for paused domain.
Signed-off-by: Masaki Kanno <kanno.masaki@xxxxxxxxxxxxxx>
---
 tools/python/xen/xend/XendDomain.py |   15 +++++++++++----
 tools/python/xen/xm/main.py         |    4 ++--
 2 files changed, 13 insertions(+), 6 deletions(-)

diff -r 9f4f70233041 -r 9a7cbde124a5 tools/python/xen/xend/XendDomain.py
--- a/tools/python/xen/xend/XendDomain.py       Fri Sep 14 16:05:39 2007 +0100
+++ b/tools/python/xen/xend/XendDomain.py       Fri Sep 14 16:07:18 2007 +0100
@@ -1176,12 +1176,16 @@ class XendDomain:
             log.exception("domain_unpause")
             raise XendError(str(ex))
 
-    def domain_pause(self, domid):
+    def domain_pause(self, domid, state=False):
         """Pause domain execution.
 
         @param domid: Domain ID or Name
         @type domid: int or string.
-        @rtype: None
+        @keyword state: If True, will return the domain state before pause
+        @type state: bool
+        @rtype: int if state is True
+        @return: Domain state (DOM_STATE_*)
+        @rtype: None if state is False
         @raise XendError: Failed to pause
         @raise XendInvalidDomain: Domain is not valid
         """        
@@ -1191,13 +1195,16 @@ class XendDomain:
                 raise XendInvalidDomain(str(domid))
             if dominfo.getDomid() == DOM0_ID:
                 raise XendError("Cannot pause privileged domain %s" % domid)
-            if dominfo._stateGet() not in (DOM_STATE_RUNNING, 
DOM_STATE_PAUSED):
+            ds = dominfo._stateGet()
+            if ds not in (DOM_STATE_RUNNING, DOM_STATE_PAUSED):
                 raise VMBadState("Domain '%s' is not started" % domid,
                                  POWER_STATE_NAMES[DOM_STATE_RUNNING],
-                                 POWER_STATE_NAMES[dominfo._stateGet()])
+                                 POWER_STATE_NAMES[ds])
             log.info("Domain %s (%d) paused.", dominfo.getName(),
                      int(dominfo.getDomid()))
             dominfo.pause()
+            if state:
+                return ds
         except XendInvalidDomain:
             log.exception("domain_pause")
             raise
diff -r 9f4f70233041 -r 9a7cbde124a5 tools/python/xen/xm/main.py
--- a/tools/python/xen/xm/main.py       Fri Sep 14 16:05:39 2007 +0100
+++ b/tools/python/xen/xm/main.py       Fri Sep 14 16:07:18 2007 +0100
@@ -1287,13 +1287,13 @@ def xm_dump_core(args):
         filename = None
 
     if not live:
-        server.xend.domain.pause(dom)
+        ds = server.xend.domain.pause(dom, True)
 
     try:
         print "Dumping core of domain: %s ..." % str(dom)
         server.xend.domain.dump(dom, filename, live, crash)
     finally:
-        if not live:
+        if not live and ds == DOM_STATE_RUNNING:
             server.xend.domain.unpause(dom)
 
     if crash:

_______________________________________________
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] Fix xm dump-core command for paused domain., Xen patchbot-unstable <=