ia64/xen-unstable
changeset 11587:e6388ec26a97
[XEND] Do not attempt core dump to directories.
- Abort core dump if destination is a directory.
- Throw appropriate XendError expection on failure.
Reported by Masaki Kanno <kanno.masaki@jp.fujitsu.com>.
Signed-off-by: Alastair Tse <atse@xensource.com>
- Abort core dump if destination is a directory.
- Throw appropriate XendError expection on failure.
Reported by Masaki Kanno <kanno.masaki@jp.fujitsu.com>.
Signed-off-by: Alastair Tse <atse@xensource.com>
author | atse@norwich.uk.xensource.com |
---|---|
date | Fri Sep 22 16:20:36 2006 +0100 (2006-09-22) |
parents | 332bdaab35fa |
children | 92bfc59726a4 |
files | tools/python/xen/xend/XendDomainInfo.py |
line diff
1.1 --- a/tools/python/xen/xend/XendDomainInfo.py Fri Sep 22 15:56:19 2006 +0100 1.2 +++ b/tools/python/xen/xend/XendDomainInfo.py Fri Sep 22 16:20:36 2006 +0100 1.3 @@ -988,14 +988,18 @@ class XendDomainInfo: 1.4 this_time = time.strftime("%Y-%m%d-%H%M.%S", time.localtime()) 1.5 corefile = "/var/xen/dump/%s-%s.%s.core" % (this_time, 1.6 self.info['name'], self.domid) 1.7 + 1.8 + if os.path.isdir(corefile): 1.9 + raise XendError("Cannot dump core in a directory: %s" % 1.10 + corefile) 1.11 + 1.12 xc.domain_dumpcore(self.domid, corefile) 1.13 - 1.14 - except: 1.15 + except RuntimeError, ex: 1.16 corefile_incomp = corefile+'-incomplete' 1.17 os.rename(corefile, corefile_incomp) 1.18 log.exception("XendDomainInfo.dumpCore failed: id = %s name = %s", 1.19 self.domid, self.info['name']) 1.20 - 1.21 + raise XendError("Failed to dump core: %s" % str(ex)) 1.22 1.23 ## public: 1.24