From 39ba2ea61f510512764e6f9063a8396d05fe57fe Mon Sep 17 00:00:00 2001 From: Peter Xu Date: Thu, 18 Feb 2016 13:16:54 +0800 Subject: Dump: add qmp command "query-dump" When dump-guest-memory is requested with detach flag, after its return, user could query its status using "query-dump" command (with no argument). The result contains: - status: current dump status - completed: bytes written in the latest dump - total: bytes to write in the latest dump From completed and total, we could know how much work finished by calculating: 100.0 * completed / total (%) Reviewed-by: Fam Zheng Signed-off-by: Peter Xu Message-Id: <1455772616-8668-10-git-send-email-peterx@redhat.com> Signed-off-by: Paolo Bonzini --- qapi-schema.json | 32 +++++++++++++++++++++++++++++++- 1 file changed, 31 insertions(+), 1 deletion(-) (limited to 'qapi-schema.json') diff --git a/qapi-schema.json b/qapi-schema.json index ccd30c8a99..7b8f2a13e6 100644 --- a/qapi-schema.json +++ b/qapi-schema.json @@ -2196,7 +2196,8 @@ # is the fd's name. # # @detach: #optional if true, QMP will return immediately rather than -# waiting for the dump to finish. (since 2.6). +# waiting for the dump to finish. The user can track progress +# using "query-dump". (since 2.6). # # @begin: #optional if specified, the starting physical address. # @@ -2236,6 +2237,35 @@ { 'enum': 'DumpStatus', 'data': [ 'none', 'active', 'completed', 'failed' ] } +## +# @DumpQueryResult +# +# The result format for 'query-dump'. +# +# @status: enum of @DumpStatus, which shows current dump status +# +# @completed: bytes written in latest dump (uncompressed) +# +# @total: total bytes to be written in latest dump (uncompressed) +# +# Since 2.6 +## +{ 'struct': 'DumpQueryResult', + 'data': { 'status': 'DumpStatus', + 'completed': 'int', + 'total': 'int' } } + +## +# @query-dump +# +# Query latest dump status. +# +# Returns: A @DumpStatus object showing the dump status. +# +# Since: 2.6 +## +{ 'command': 'query-dump', 'returns': 'DumpQueryResult' } + ## # @DumpGuestMemoryCapability: # -- cgit v1.2.3