Skip to contentSkip to conversation

Fix xm dump-core command for inactive managed domains

PATCH New Masaki Kanno 1 participant 1 message Jul 11, 2007

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Fix xm dump-core command for inactive managed domains

Hi,

When I tried xm dump-core command to a inactive managed domain, I saw the following error messages.
The 1st error message was solved by changeset 15519. But the 2nd error message is not yet solved.

# xm list vm1
Name                                        ID   Mem VCPUs      State   Time(s)
vm1                                              256     2                 0.0
# xm dump-core vm1
Error: int() argument must be a string or a number
Usage: xm dump-core [-L|--live] [-C|--crash] <Domain> [Filename]

Dump core for a specific domain.
-L, --live Dump core without pausing the domain
-C, --crash Crash domain after dumping core

# xm dump-core --live vm1
Dumping core of domain: vm1 ...
Error: int argument required
Usage: xm dump-core [-L|--live] [-C|--crash] <Domain> [Filename]

Dump core for a specific domain.
-L, --live Dump core without pausing the domain
-C, --crash Crash domain after dumping core

This patch fixes the 2nd error message as follows.

# xm dump-core --live vm1
Dumping core of domain: vm1 ...
Error: Domain 'vm1' is not started
Usage: xm dump-core [-L|--live] [-C|--crash] <Domain> [Filename]

Dump core for a specific domain.
-L, --live Dump core without pausing the domain
-C, --crash Crash domain after dumping core

Best regards,
Kan

tools/python/xen/xend/XendDomain.py +4 -0
diff -r 1f348e70a5af tools/python/xen/xend/XendDomain.py
@@ -1164,6 +1164,10 @@ class XendDomain:
 
         if dominfo.getDomid() == DOM0_ID:
             raise XendError("Cannot dump core for privileged domain %s" % domid)
+        if dominfo._stateGet() not in (DOM_STATE_PAUSED, DOM_STATE_RUNNING):
+            raise VMBadState("Domain '%s' is not started" % domid,
+                             POWER_STATE_NAMES[DOM_STATE_PAUSED],
+                             POWER_STATE_NAMES[dominfo._stateGet()])
 
         try:
             log.info("Domain core dump requested for domain %s (%d) "

_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xensource.com/xen-devel