From bcada37b19e79329c47a956c4c2dd5c81727e8c8 Mon Sep 17 00:00:00 2001 From: Wenchao Xia Date: Wed, 18 Jun 2014 08:43:47 +0200 Subject: qapi event: convert other BLOCK_JOB events Since BLOCK_JOB_COMPLETED, BLOCK_JOB_CANCELLED, BLOCK_JOB_READY are related, convert them in one patch. The block_job_event_* functions are used to keep encapsulation of BlockJob structure. Signed-off-by: Wenchao Xia Signed-off-by: Paolo Bonzini Reviewed-by: Eric Blake Signed-off-by: Luiz Capitulino --- qapi/block-core.json | 71 ++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 71 insertions(+) (limited to 'qapi/block-core.json') diff --git a/qapi/block-core.json b/qapi/block-core.json index 2dbac42558..af6b436540 100644 --- a/qapi/block-core.json +++ b/qapi/block-core.json @@ -1472,6 +1472,62 @@ 'data': { 'device': 'str', 'operation': 'IoOperationType', 'action': 'BlockErrorAction' } } +## +# @BLOCK_JOB_COMPLETED +# +# Emitted when a block job has completed +# +# @type: job type +# +# @device: device name +# +# @len: maximum progress value +# +# @offset: current progress value. On success this is equal to len. +# On failure this is less than len +# +# @speed: rate limit, bytes per second +# +# @error: #optional, error message. Only present on failure. This field +# contains a human-readable error message. There are no semantics +# other than that streaming has failed and clients should not try to +# interpret the error string +# +# Since: 1.1 +## +{ 'event': 'BLOCK_JOB_COMPLETED', + 'data': { 'type' : 'BlockJobType', + 'device': 'str', + 'len' : 'int', + 'offset': 'int', + 'speed' : 'int', + '*error': 'str' } } + +## +# @BLOCK_JOB_CANCELLED +# +# Emitted when a block job has been cancelled +# +# @type: job type +# +# @device: device name +# +# @len: maximum progress value +# +# @offset: current progress value. On success this is equal to len. +# On failure this is less than len +# +# @speed: rate limit, bytes per second +# +# Since: 1.1 +## +{ 'event': 'BLOCK_JOB_CANCELLED', + 'data': { 'type' : 'BlockJobType', + 'device': 'str', + 'len' : 'int', + 'offset': 'int', + 'speed' : 'int' } } + ## # @BLOCK_JOB_ERROR # @@ -1489,3 +1545,18 @@ 'data': { 'device' : 'str', 'operation': 'IoOperationType', 'action' : 'BlockdevOnError' } } + +## +# @BLOCK_JOB_READY +# +# Emitted when a block job is ready to complete +# +# @device: device name +# +# Note: The "ready to complete" status is always reset by a @BLOCK_JOB_ERROR +# event +# +# Since: 1.3 +## +{ 'event': 'BLOCK_JOB_READY', + 'data': { 'device': 'str' } } -- cgit v1.2.3