aboutsummaryrefslogtreecommitdiff
path: root/blockjob.c
diff options
context:
space:
mode:
authorMax Reitz <mreitz@redhat.com>2014-10-24 15:57:34 +0200
committerStefan Hajnoczi <stefanha@redhat.com>2014-11-03 11:41:48 +0000
commitef6dbf1e46ebd1d41ab669df5bba0bbdec6bd374 (patch)
treeb41e965b2dc886f42c9076fb8369402287c5134d /blockjob.c
parent345f9e1b04ee18dcb1454dcec49781d5e06ecb60 (diff)
blockjob: Add "ready" field
When a block job signals readiness, this is currently reported only through QMP. If qemu wants to use block jobs for internal tasks, there needs to be another way to correctly detect when a block job may be completed. For this reason, introduce a bool "ready" which is set when the block job may be completed. Signed-off-by: Max Reitz <mreitz@redhat.com> Reviewed-by: Eric Blake <eblake@redhat.com> Reviewed-by: Kevin Wolf <kwolf@redhat.com> Message-id: 1414159063-25977-6-git-send-email-mreitz@redhat.com Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
Diffstat (limited to 'blockjob.c')
-rw-r--r--blockjob.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/blockjob.c b/blockjob.c
index a7d57e3d33..448b9ce113 100644
--- a/blockjob.c
+++ b/blockjob.c
@@ -261,6 +261,7 @@ BlockJobInfo *block_job_query(BlockJob *job)
info->offset = job->offset;
info->speed = job->speed;
info->io_status = job->iostatus;
+ info->ready = job->ready;
return info;
}
@@ -296,6 +297,8 @@ void block_job_event_completed(BlockJob *job, const char *msg)
void block_job_event_ready(BlockJob *job)
{
+ job->ready = true;
+
qapi_event_send_block_job_ready(job->driver->job_type,
bdrv_get_device_name(job->bs),
job->len,