Fix rename issue of xm dump-core
PATCH 1/1 Fix rename issue of xm dump-core
Hi,
When I specified a directory to xm dump-core command, the directory was renamed.
# mkdir /xen/dump # ll /xen/ drwxr-xr-x 2 root root 4096 Sep 19 21:04 dump # xm dump-core vm1 /xen/dump dumping core of domain:vm1 ... # ll /xen/ drwxr-xr-x 2 root root 4096 Sep 19 21:04 dump-incomplete
This patch fixes this issue, and shows an error message.
# xm dump-core vm1 /xen/dump dumping core of domain:vm1 ... Error: core dump failed: (21, 'Is a directory')
Best regards,
Kan
tools/python/xen/xend/XendDomainInfo.py +7 -5
@@ -988,11 +988,13 @@ class XendDomainInfo: 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']) + except RuntimeError, ex: + if int(ex[0]) not in (errno.ENOENT, errno.EISDIR): + 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("core dump failed: " + str(ex)) ## public:
_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xensource.com/xen-devel
Quoted 5 lines · Masaki Kanno
This patch fixes this issue, and shows an error message.
# xm dump-core vm1 /xen/dump dumping core of domain:vm1 ... Error: core dump failed: (21, 'Is a directory')
Rather than handling the core dump failure for a directory with a special case, I've added a check before the dump to make sure the file name supplied is not a directory.
Thanks,
Alastair
Hi Alastair,
Thanks for your modification.
I sent a bug fix patch one more about xm dump-core command. Could you apply it?
http://lists.xensource.com/archives/html/xen-devel/2006-09/msg00532.html
Best reagrds,
Kan
Quoted 20 lines · Masaki Kanno
Quoted 5 lines
This patch fixes this issue, and shows an error message.
# xm dump-core vm1 /xen/dump dumping core of domain:vm1 ... Error: core dump failed: (21, 'Is a directory')Rather than handling the core dump failure for a directory with a special case, I've added a check before the dump to make sure the file name supplied is not a directory.
Thanks,
Alastair
_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xensource.com/xen-devel
Yes, I think that patch makes a a lot of sense. There is an unnecessary getopt import and the exceptions need to be caught and reported appropriately.
I'll apply this patch shortly.
Cheers,
Alastair
Quoted 33 lines · Masaki Kanno
Hi Alastair,
Thanks for your modification.
I sent a bug fix patch one more about xm dump-core command. Could you apply it?
http://lists.xensource.com/archives/html/xen-devel/2006-09/msg00532.html
Best reagrds,
KanQuoted 20 lines · Masaki Kanno
Quoted 5 lines
This patch fixes this issue, and shows an error message.
# xm dump-core vm1 /xen/dump dumping core of domain:vm1 ... Error: core dump failed: (21, 'Is a directory')Rather than handling the core dump failure for a directory with a special case, I've added a check before the dump to make sure the file name supplied is not a directory.
Thanks,
Alastair
_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xensource.com/xen-devel