ia64/xen-unstable
changeset 19356:3c1a88dc6fbe
xend: Fix domain core-dumping about reset option
This patch moves a call processing of a domain reset processing
from xm to xend. Also, it adds a reset argument to do_dump() of
SrvDomain.py.
Signed-off-by: Masaki Kanno <kanno.masaki@jp.fujitsu.com>
This patch moves a call processing of a domain reset processing
from xm to xend. Also, it adds a reset argument to do_dump() of
SrvDomain.py.
Signed-off-by: Masaki Kanno <kanno.masaki@jp.fujitsu.com>
author | Keir Fraser <keir.fraser@citrix.com> |
---|---|
date | Fri Mar 13 07:38:05 2009 +0000 (2009-03-13) |
parents | 2377bb2d0316 |
children | f97e737373cd |
files | tools/python/xen/xend/XendDomain.py tools/python/xen/xend/server/SrvDomain.py tools/python/xen/xm/main.py |
line diff
1.1 --- a/tools/python/xen/xend/XendDomain.py Fri Mar 13 07:37:24 2009 +0000 1.2 +++ b/tools/python/xen/xend/XendDomain.py Fri Mar 13 07:38:05 2009 +0000 1.3 @@ -1223,7 +1223,7 @@ class XendDomain: 1.4 log.exception("domain_pause") 1.5 raise XendError(str(ex)) 1.6 1.7 - def domain_dump(self, domid, filename, live, crash): 1.8 + def domain_dump(self, domid, filename=None, live=False, crash=False, reset=False): 1.9 """Dump domain core.""" 1.10 1.11 dominfo = self.domain_lookup_nr(domid) 1.12 @@ -1244,15 +1244,17 @@ class XendDomain: 1.13 try: 1.14 try: 1.15 log.info("Domain core dump requested for domain %s (%d) " 1.16 - "live=%d crash=%d.", 1.17 - dominfo.getName(), dominfo.getDomid(), live, crash) 1.18 + "live=%d crash=%d reset=%d.", 1.19 + dominfo.getName(), dominfo.getDomid(), live, crash, reset) 1.20 dominfo.dumpCore(filename) 1.21 if crash: 1.22 self.domain_destroy(domid) 1.23 + elif reset: 1.24 + self.domain_reset(domid) 1.25 except Exception, ex: 1.26 raise XendError(str(ex)) 1.27 finally: 1.28 - if dopause and not crash: 1.29 + if dopause and not crash and not reset: 1.30 dominfo.unpause() 1.31 1.32 def domain_destroy(self, domid):
2.1 --- a/tools/python/xen/xend/server/SrvDomain.py Fri Mar 13 07:37:24 2009 +0000 2.2 +++ b/tools/python/xen/xend/server/SrvDomain.py Fri Mar 13 07:38:05 2009 +0000 2.3 @@ -104,7 +104,8 @@ class SrvDomain(SrvDir): 2.4 [['dom', 'int'], 2.5 ['file', 'str'], 2.6 ['live', 'int'], 2.7 - ['crash', 'int']]) 2.8 + ['crash', 'int'], 2.9 + ['reset', 'int']]) 2.10 return fn(req.args, {'dom': self.dom.domid}) 2.11 2.12 def op_migrate(self, op, req):
3.1 --- a/tools/python/xen/xm/main.py Fri Mar 13 07:37:24 2009 +0000 3.2 +++ b/tools/python/xen/xm/main.py Fri Mar 13 07:38:05 2009 +0000 3.3 @@ -1352,9 +1352,7 @@ def xm_dump_core(args): 3.4 filename = None 3.5 3.6 print "Dumping core of domain: %s ..." % str(dom) 3.7 - server.xend.domain.dump(dom, filename, live, crash) 3.8 - if reset: 3.9 - server.xend.domain.reset(dom) 3.10 + server.xend.domain.dump(dom, filename, live, crash, reset) 3.11 3.12 def xm_rename(args): 3.13 arg_check(args, "rename", 2)