diff options
author | Paolo Bonzini <pbonzini@redhat.com> | 2012-09-28 17:22:48 +0200 |
---|---|---|
committer | Kevin Wolf <kwolf@redhat.com> | 2012-09-28 19:14:32 +0200 |
commit | 30e628b709fcd30db298878e435e3bc93919c48c (patch) | |
tree | 1d9bcf6a53e2d17de6d8dc659ac68d2a2b78cfc2 /blockjob.c | |
parent | 2f0c9fe64c6a2887047b7eab05cd85b2643234c8 (diff) |
block: add block_job_query
Extract it out of the implementation of info block-jobs.
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Diffstat (limited to 'blockjob.c')
-rw-r--r-- | blockjob.c | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/blockjob.c b/blockjob.c index 9737a43b27..dea63f8c1f 100644 --- a/blockjob.c +++ b/blockjob.c @@ -161,3 +161,14 @@ void block_job_sleep_ns(BlockJob *job, QEMUClock *clock, int64_t ns) job->busy = true; } } + +BlockJobInfo *block_job_query(BlockJob *job) +{ + BlockJobInfo *info = g_new0(BlockJobInfo, 1); + info->type = g_strdup(job->job_type->job_type); + info->device = g_strdup(bdrv_get_device_name(job->bs)); + info->len = job->len; + info->offset = job->offset; + info->speed = job->speed; + return info; +} |