mirror of
https://github.com/mii443/qemu.git
synced 2025-09-03 23:59:38 +00:00
blockjob: centralize QMP event emissions
There's no reason to leave this to blockdev; we can do it in blockjobs directly and get rid of an extra callback for most users. All non-internal events, even those created outside of QMP, will consistently emit events. Signed-off-by: John Snow <jsnow@redhat.com> Reviewed-by: Kevin Wolf <kwolf@redhat.com> Reviewed-by: Jeff Cody <jcody@redhat.com> Message-id: 1477584421-1399-5-git-send-email-jsnow@redhat.com Signed-off-by: Jeff Cody <jcody@redhat.com>
This commit is contained in:
@ -209,8 +209,8 @@ static const BlockJobDriver commit_job_driver = {
|
||||
|
||||
void commit_start(const char *job_id, BlockDriverState *bs,
|
||||
BlockDriverState *base, BlockDriverState *top, int64_t speed,
|
||||
BlockdevOnError on_error, BlockCompletionFunc *cb,
|
||||
void *opaque, const char *backing_file_str, Error **errp)
|
||||
BlockdevOnError on_error, const char *backing_file_str,
|
||||
Error **errp)
|
||||
{
|
||||
CommitBlockJob *s;
|
||||
BlockReopenQueue *reopen_queue = NULL;
|
||||
@ -234,7 +234,7 @@ void commit_start(const char *job_id, BlockDriverState *bs,
|
||||
}
|
||||
|
||||
s = block_job_create(job_id, &commit_job_driver, bs, speed,
|
||||
BLOCK_JOB_DEFAULT, cb, opaque, errp);
|
||||
BLOCK_JOB_DEFAULT, NULL, NULL, errp);
|
||||
if (!s) {
|
||||
return;
|
||||
}
|
||||
@ -290,7 +290,7 @@ void commit_start(const char *job_id, BlockDriverState *bs,
|
||||
s->on_error = on_error;
|
||||
s->common.co = qemu_coroutine_create(commit_run, s);
|
||||
|
||||
trace_commit_start(bs, base, top, s, s->common.co, opaque);
|
||||
trace_commit_start(bs, base, top, s, s->common.co);
|
||||
qemu_coroutine_enter(s->common.co);
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user