[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH v2 5/8] dump-query: add "dump-query" command to
From: |
Eric Blake |
Subject: |
Re: [Qemu-devel] [PATCH v2 5/8] dump-query: add "dump-query" command to query dump status |
Date: |
Mon, 30 Nov 2015 11:27:35 -0700 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.3.0 |
On 11/26/2015 07:48 PM, Peter Xu wrote:
> This patch is only adding the QMP/HMP interface for "dump-query"
> command, but not implementing them. This command could be used to
> query background dump status. Please refer to the next patch to see
> how dump status are defined.
>
> Currently, only fake results are returned.
Feels a bit awkward to return fake results; maybe you should squash some
patches together or fail with an error instead of returning fake results.
>
> Signed-off-by: Peter Xu <address@hidden>
> ---
> dump.c | 9 +++++++++
> hmp-commands.hx | 15 +++++++++++++++
> hmp.c | 6 ++++++
> hmp.h | 1 +
> qapi-schema.json | 21 +++++++++++++++++++++
> qmp-commands.hx | 29 ++++++++++++++++++++++++++++-
> 6 files changed, 80 insertions(+), 1 deletion(-)
>
> +++ b/qapi-schema.json
> @@ -2139,6 +2139,27 @@
> '*format': 'DumpGuestMemoryFormat'} }
>
> ##
> +# @DumpStatus
> +#
> +# Status for the last guest memory dump.
> +#
Missing documentation for 'status' and 'percentage' fields.
> +# Since: 2.6
> +##
> +{ 'struct': 'DumpStatus',
> + 'data': { 'status': 'str', 'percentage': 'str' } }
What values will 'status' contain? If it is a finite set of status
strings, then it should be an enum type.
'percentage' should NOT be a string. It should probably be numeric;
'number' if you intend to return a floating point value between 0 and 1.
Or, like other interfaces, you should probably return two numbers
(current and total, both 'int'), and let the caller compute percentage
themselves.
> +
> +##
> +# @dump-query
Most query commands are named 'query-FOO', not 'FOO-query'. Unless you
have a compelling reason otherwise, this should be 'query-dump'.
> +#
> +# Query latest dump status.
> +#
> +# Returns: A @DumpStatus object showing the dump status.
> +#
> +# Since: 2.6
> +##
> +{ 'command': 'dump-query', 'returns': 'DumpStatus' }
> +
> +SQMP
> +dump-query
> +----------
> +
> +Query background dump status.
> +
> +Arguments: None.
> +
> +Example:
> +
> +-> { "execute": "dump-query" }
> +<- { "return": {"status": "IN_PROGRESS", "percentage": "85%" } }
ALL_CAPS status is annoying to read; if you add an enum type, it should
be 'lower-case' values.
--
Eric Blake eblake redhat com +1-919-301-3266
Libvirt virtualization library http://libvirt.org
signature.asc
Description: OpenPGP digital signature
- Re: [Qemu-devel] [PATCH v2 4/8] dump-guest-memory: add qmp event DUMP_COMPLETED, (continued)
- Re: [Qemu-devel] [PATCH v2 5/8] dump-query: add "dump-query" command to query dump status,
Eric Blake <=
[Qemu-devel] [PATCH v2 6/8] dump-query: implement "status" of "dump-query" command., Peter Xu, 2015/11/26
[Qemu-devel] [PATCH v2 7/8] DumpState: adding total_size and written_size fields, Peter Xu, 2015/11/26
[Qemu-devel] [PATCH v2 8/8] dump-query: make the percentage accurate., Peter Xu, 2015/11/26
Re: [Qemu-devel] [PATCH v2 0/8] Add basic "detach" support for dump-guest-memory, Peter Xu, 2015/11/26
Re: [Qemu-devel] [PATCH v2 0/8] Add basic "detach" support for dump-guest-memory, Fam Zheng, 2015/11/27