[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH v2 2.1 1/3] blockjob: Fix recent BLOCK_JOB_READY reg
From: |
Markus Armbruster |
Subject: |
[Qemu-devel] [PATCH v2 2.1 1/3] blockjob: Fix recent BLOCK_JOB_READY regression |
Date: |
Fri, 27 Jun 2014 19:24:13 +0200 |
Commit bcada37 dropped the (up to now undocumented) members type, len,
offset, speed, breaking tests/qemu-iotests/040 and 041.
Restore and document them. This fixes 040, and partially fixes 041.
Signed-off-by: Markus Armbruster <address@hidden>
Tested-By: Benoit Canet <address@hidden>
---
blockjob.c | 6 +++++-
qapi/block-core.json | 15 ++++++++++++++-
2 files changed, 19 insertions(+), 2 deletions(-)
diff --git a/blockjob.c b/blockjob.c
index 4da86cd..37a8f1f 100644
--- a/blockjob.c
+++ b/blockjob.c
@@ -256,7 +256,11 @@ void block_job_event_completed(BlockJob *job, const char
*msg)
void block_job_event_ready(BlockJob *job)
{
- qapi_event_send_block_job_ready(bdrv_get_device_name(job->bs),
&error_abort);
+ qapi_event_send_block_job_ready(job->driver->job_type,
+ bdrv_get_device_name(job->bs),
+ job->len,
+ job->offset,
+ job->speed, &error_abort);
}
BlockErrorAction block_job_error_action(BlockJob *job, BlockDriverState *bs,
diff --git a/qapi/block-core.json b/qapi/block-core.json
index af6b436..822fe16 100644
--- a/qapi/block-core.json
+++ b/qapi/block-core.json
@@ -1551,12 +1551,25 @@
#
# Emitted when a block job is ready to complete
#
+# @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
+#
# 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' } }
+ 'data': { 'type' : 'BlockJobType',
+ 'device': 'str',
+ 'len' : 'int',
+ 'offset': 'int',
+ 'speed' : 'int' } }
--
1.9.3