qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Andrew Jones <drjones@redhat.com>
To: Peter Xu <peterx@redhat.com>
Cc: pbonzini@redhat.com, lcapitulino@redhat.com,
	qemu-devel@nongnu.org, armbru@redhat.com
Subject: Re: [Qemu-devel] [PATCH REPOST 1/2] dump-guest-memory: add "detach" flag for QMP/HMP interfaces
Date: Mon, 23 Nov 2015 10:48:55 -0500	[thread overview]
Message-ID: <20151123154855.GC3606@hawk.localdomain> (raw)
In-Reply-To: <1448273262-13845-2-git-send-email-peterx@redhat.com>

On Mon, Nov 23, 2015 at 06:07:41PM +0800, Peter Xu wrote:
> This patch only add the interfaces, but not implementing them.
> 
> Signed-off-by: Peter Xu <peterx@redhat.com>
> ---
>  dump.c           | 3 ++-
>  hmp-commands.hx  | 5 +++--
>  hmp.c            | 3 ++-
>  qapi-schema.json | 3 ++-
>  qmp-commands.hx  | 4 ++--
>  5 files changed, 11 insertions(+), 7 deletions(-)
> 
> diff --git a/dump.c b/dump.c
> index 78b7d84..3ec3423 100644
> --- a/dump.c
> +++ b/dump.c
> @@ -1598,7 +1598,8 @@ cleanup:
>  void qmp_dump_guest_memory(bool paging, const char *file, bool has_begin,
>                             int64_t begin, bool has_length,
>                             int64_t length, bool has_format,
> -                           DumpGuestMemoryFormat format, Error **errp)
> +                           DumpGuestMemoryFormat format, bool detach,
> +                           Error **errp)
>  {
>      const char *p;
>      int fd = -1;
> diff --git a/hmp-commands.hx b/hmp-commands.hx
> index bb52e4d..8e27671 100644
> --- a/hmp-commands.hx
> +++ b/hmp-commands.hx
> @@ -1056,10 +1056,11 @@ ETEXI
>  
>      {
>          .name       = "dump-guest-memory",
> -        .args_type  = "paging:-p,zlib:-z,lzo:-l,snappy:-s,filename:F,begin:i?,length:i?",
> -        .params     = "[-p] [-z|-l|-s] filename [begin length]",
> +        .args_type  = "paging:-p,detach:-d,zlib:-z,lzo:-l,snappy:-s,filename:F,begin:i?,length:i?",
> +        .params     = "[-p] [-d] [-z|-l|-s] filename [begin length]",
>          .help       = "dump guest memory into file 'filename'.\n\t\t\t"
>                        "-p: do paging to get guest's memory mapping.\n\t\t\t"
> +                      "-d: return immediately (not wait for completion).\n\t\t\t"

(do not wait...)

>                        "-z: dump in kdump-compressed format, with zlib compression.\n\t\t\t"
>                        "-l: dump in kdump-compressed format, with lzo compression.\n\t\t\t"
>                        "-s: dump in kdump-compressed format, with snappy compression.\n\t\t\t"
> diff --git a/hmp.c b/hmp.c
> index 2140605..4c5480d 100644
> --- a/hmp.c
> +++ b/hmp.c
> @@ -1580,6 +1580,7 @@ void hmp_dump_guest_memory(Monitor *mon, const QDict *qdict)
>  {
>      Error *err = NULL;
>      bool paging = qdict_get_try_bool(qdict, "paging", false);
> +    bool detach = qdict_get_try_bool(qdict, "detach", false);
>      bool zlib = qdict_get_try_bool(qdict, "zlib", false);
>      bool lzo = qdict_get_try_bool(qdict, "lzo", false);
>      bool snappy = qdict_get_try_bool(qdict, "snappy", false);
> @@ -1619,7 +1620,7 @@ void hmp_dump_guest_memory(Monitor *mon, const QDict *qdict)
>      prot = g_strconcat("file:", file, NULL);
>  
>      qmp_dump_guest_memory(paging, prot, has_begin, begin, has_length, length,
> -                          true, dump_format, &err);
> +                          true, dump_format, detach, &err);
>      hmp_handle_error(mon, &err);
>      g_free(prot);
>  }
> diff --git a/qapi-schema.json b/qapi-schema.json
> index 8b1a423..1211082 100644
> --- a/qapi-schema.json
> +++ b/qapi-schema.json
> @@ -2132,7 +2132,8 @@
>  ##
>  { 'command': 'dump-guest-memory',
>    'data': { 'paging': 'bool', 'protocol': 'str', '*begin': 'int',
> -            '*length': 'int', '*format': 'DumpGuestMemoryFormat' } }
> +            '*length': 'int', '*format': 'DumpGuestMemoryFormat',
> +            'detach': 'bool'} }

For consistency I would put detach after paging.

>  
>  ##
>  # @DumpGuestMemoryCapability:
> diff --git a/qmp-commands.hx b/qmp-commands.hx
> index 9d8b42f..86864f6 100644
> --- a/qmp-commands.hx
> +++ b/qmp-commands.hx
> @@ -840,8 +840,8 @@ EQMP
>  
>      {
>          .name       = "dump-guest-memory",
> -        .args_type  = "paging:b,protocol:s,begin:i?,end:i?,format:s?",
> -        .params     = "-p protocol [begin] [length] [format]",
> +        .args_type  = "paging:b,detach:d,protocol:s,begin:i?,end:i?,format:s?",
> +        .params     = "-p protocol [-d] [begin] [length] [format]",

shouldn't this be -p -d protocol [begin] [length] [format]

>          .help       = "dump guest memory to file",
>          .mhandler.cmd_new = qmp_marshal_dump_guest_memory,
>      },
> -- 
> 2.4.3
> 
> 

  reply	other threads:[~2015-11-23 15:49 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-11-23 10:07 [Qemu-devel] [PATCH REPOST 0/2] Add basic "detach" support for dump-guest-memory Peter Xu
2015-11-23 10:07 ` [Qemu-devel] [PATCH REPOST 1/2] dump-guest-memory: add "detach" flag for QMP/HMP interfaces Peter Xu
2015-11-23 15:48   ` Andrew Jones [this message]
2015-11-23 16:10   ` Eric Blake
2015-11-24  2:40     ` Fam Zheng
2015-11-23 10:07 ` [Qemu-devel] [PATCH REPOST 2/2] dump-guest-memory: add basic "detach" support Peter Xu
2015-11-23 15:56   ` Daniel P. Berrange
2015-11-23 16:08   ` Andrew Jones
2015-11-23 16:09 ` [Qemu-devel] [PATCH REPOST 0/2] Add basic "detach" support for dump-guest-memory Eric Blake
2015-11-23 16:22 ` Laszlo Ersek
2015-11-23 17:57   ` Andrew Jones
2015-11-24  1:57     ` Peter Xu
2015-11-24  3:10       ` Fam Zheng
2015-11-24 11:14         ` Laszlo Ersek
2015-11-24 11:37           ` Fam Zheng
2015-11-24 13:49             ` Eric Blake
2015-11-25  2:46               ` Fam Zheng
2015-11-25  4:48                 ` Peter Xu
2015-11-25  4:57                   ` Fam Zheng
2015-11-25  8:37               ` Markus Armbruster
2015-11-24 12:05         ` Paolo Bonzini
2015-11-24 13:36           ` Laszlo Ersek
2015-11-24 14:32             ` Paolo Bonzini
2015-11-25  5:07           ` Peter Xu

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=20151123154855.GC3606@hawk.localdomain \
    --to=drjones@redhat.com \
    --cc=armbru@redhat.com \
    --cc=lcapitulino@redhat.com \
    --cc=pbonzini@redhat.com \
    --cc=peterx@redhat.com \
    --cc=qemu-devel@nongnu.org \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).