[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>
This commit is contained in:
atse@norwich.uk.xensource.com committed 2006-09-22 16:20:36 +01:00
1 parent 15473a42cf
commit cef39afbe9
1 file changed
+7 -3
+7 -3
View File
@@ -988,14 +988,18 @@ class XendDomainInfo:
this_time = time.strftime("%Y-%m%d-%H%M.%S", time.localtime())
corefile = "/var/xen/dump/%s-%s.%s.core" % (this_time,
self.info['name'], self.domid)
if os.path.isdir(corefile):
raise XendError("Cannot dump core in a directory: %s" %
corefile)
xc.domain_dumpcore(self.domid, corefile)
except:
except RuntimeError, ex:
corefile_incomp = corefile+'-incomplete'
os.rename(corefile, corefile_incomp)
log.exception("XendDomainInfo.dumpCore failed: id = %s name = %s",
self.domid, self.info['name'])
raise XendError("Failed to dump core: %s" % str(ex))
## public:
Reference in new issue
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.