Change dumpcore filename
PATCH 1/1 Change dumpcore filename
Hi,
This patch add localtime to dumpcore filename.
And it add '-imcomplete' if failed.
Signed-off-by Akio Takebe <[email protected]>
Best Regards,
Akio Takebe
# HG changeset patch
# User root@procyon
# Node ID 4700d7ec2c53bee848bd22b535b1a69811a14e9a # Parent ec03b24a2d83273ec62db8596506b80577a0e41e Change dumpcore filename
- add localtime
- add "-incomplete" if failed
Signed-off-by Akio Takebe <[email protected]>
tools/python/xen/xend/XendDomainInfo.py +5 -2
@@ -971,11 +971,14 @@ class XendDomainInfo: """Create a core dump for this domain. Nothrow guarantee.""" try: - corefile = "/var/xen/dump/%s.%s.core" % (self.info['name'], - self.domid) + 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) xc.domain_dumpcore(self.domid, corefile) except: + corefile_incomp = corefile+'-incomplete' + os.rename(corefile, corefile_incomp) log.exception("XendDomainInfo.dumpCore failed: id = %s name = %s", self.domid, self.info['name'])
_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xensource.com/xen-devel