On Wed, 20 Jun 2012 22:58:20 +0530
Rabin Vincent <ra...@rab.in> wrote:

> Make dump-guest-memory not create read-only files, so that it can
> overwrite a file created by a previous invocation without having it to
> be removed externally.

I think we need a force parameter to do this, the command shouldn't overwrite
files by default.

Wen, can you review this series please?

> 
> Signed-off-by: Rabin Vincent <ra...@rab.in>
> ---
>  dump.c |    3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/dump.c b/dump.c
> index 2bf8d8d..5c5cb4d 100644
> --- a/dump.c
> +++ b/dump.c
> @@ -845,7 +845,8 @@ void qmp_dump_guest_memory(bool paging, const char *file, 
> bool has_begin,
>  #endif
>  
>      if  (strstart(file, "file:", &p)) {
> -        fd = qemu_open(p, O_WRONLY | O_CREAT | O_TRUNC | O_BINARY, S_IRUSR);
> +        fd = qemu_open(p, O_WRONLY | O_CREAT | O_TRUNC | O_BINARY,
> +                       S_IRUSR | S_IWUSR);
>          if (fd < 0) {
>              error_set(errp, QERR_OPEN_FILE_FAILED, p);
>              return;


Reply via email to