All of lore.kernel.org
 help / color / mirror / Atom feed
From: Akio Takebe <takebe_akio@jp.fujitsu.com>
To: Kazuki Mizushima <mizushima.kazuk@jp.fujitsu.com>,
	xen-devel@lists.xensource.com
Subject: Re: [PATCH][XEND][RESEND]Reprt error for a existing file
Date: Thu, 15 Mar 2007 21:31:35 +0900	[thread overview]
Message-ID: <A7C766FDDEF580takebe_akio@jp.fujitsu.com> (raw)
In-Reply-To: <027b01c766eb$356e5780$a1ec830a@dirac>

Hi, Kazuki

I think renaming filename is better.
Common Linux dump features(e.g. diskdump, netdump, and so on) are
rename dumpfile when the same filename exist.

For example, what do you think renaming from <time>-<dom_name>.<dom_id>.core
to <time>-<dom_name>.<dom_id>.core-1?

Best Regards,

Akio Takebe

>Hi,
>
>This patch prevents output file overwriting for xm save/dump-core case.
>
>Would you give me a comment on this patch? If not, please apply it. 
>I made it again for the current.
>
>
>> #xm dump-core 12 a.dump
>> Dumping core of domain: 12 ...
>> Error: Cannot dump core for existing file /tmp/a.dump
>> Usage: xm dump-core [-L|--live] [-C|--crash] <Domain> [Filename]
>> 
>> Dump core for a specific domain.
>>  -L, --live                     Dump core without pausing the domain
>>  -C, --crash                    Crash domain after dumping core
>> 
>> # xm save 12 a.save
>> Error: Cannot save for existing file /tmp/a.save
>> Usage: xm save <Domain> <CheckpointFile>
>> 
>> Save a domain state to restore later.
>> #
>> 
>> Signed-off-by: Kazuki Mizushima <mizushima.kazuk@jp.fujitsu.com>
>
>
>Thanks,
>Kazuki Mizushima
>
>
>diff -r 517e67f0fe52 tools/python/xen/xend/XendDomain.py
>--- a/tools/python/xen/xend/XendDomain.py       Wed Mar 14 19:35:26 2007 +0000
>+++ b/tools/python/xen/xend/XendDomain.py       Thu Mar 15 18:41:49 2007 +0900
>@@ -1094,6 +1094,9 @@ class XendDomain:
>         if dominfo.getDomid() == DOM0_ID:
>             raise XendError("Cannot dump core for privileged domain %s" % 
>domid)
>
>+        if os.path.exists(filename):
>+            raise XendError("Cannot dump core for existing file %s" % 
>filename)
>+
>         try:
>             log.info("Domain core dump requested for domain %s (%d) "
>                      "live=%d crash=%d.",
>@@ -1190,6 +1193,9 @@ class XendDomain:
>
>             if dominfo.getDomid() == DOM0_ID:
>                 raise XendError("Cannot save privileged domain %i" % domid)
>+
>+            if os.path.exists(dst):
>+                raise XendError("Cannot save for existing file %s" % dst)
>
>             oflags = os.O_WRONLY | os.O_CREAT | os.O_TRUNC
>             if hasattr(os, "O_LARGEFILE"):
>
>
>
>
>
>_______________________________________________
>Xen-devel mailing list
>Xen-devel@lists.xensource.com
>http://lists.xensource.com/xen-devel

  parent reply	other threads:[~2007-03-15 12:31 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-03-07 10:47 [PATCH][XEND]Reprt error for a existing file Kazuki Mizushima
2007-03-15 10:18 ` [PATCH][XEND][RESEND]Reprt " Kazuki Mizushima
2007-03-15 10:28   ` Keir Fraser
2007-03-15 10:31     ` Petersson, Mats
2007-03-15 12:31   ` Akio Takebe [this message]
2007-03-15 12:44     ` Petersson, Mats
2007-03-16  1:37       ` Akio Takebe

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=A7C766FDDEF580takebe_akio@jp.fujitsu.com \
    --to=takebe_akio@jp.fujitsu.com \
    --cc=mizushima.kazuk@jp.fujitsu.com \
    --cc=xen-devel@lists.xensource.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.