mirror of
https://gitlab.com/qemu-project/qemu
synced 2024-10-14 23:13:30 +00:00
blockjob: assert(cb) when create job
Callback for block job should always exist Suggested-by: Paolo Bonzini <pbonzini@redhat.com> Suggested-by: Kevin Wolf <kwolf@redhat.com> Signed-off-by: Changlong Xie <xiecl.fnst@cn.fujitsu.com> Reviewed-by: Fam Zheng <famz@redhat.com> Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com> Reviewed-by: Jeff Cody <jcody@redhat.com> Message-id: 1466672241-22485-2-git-send-email-xiecl.fnst@cn.fujitsu.com Signed-off-by: Jeff Cody <jcody@redhat.com>
This commit is contained in:
parent
ccee3d8f97
commit
b48100cf07
|
@ -489,7 +489,6 @@ void backup_start(BlockDriverState *bs, BlockDriverState *target,
|
||||||
|
|
||||||
assert(bs);
|
assert(bs);
|
||||||
assert(target);
|
assert(target);
|
||||||
assert(cb);
|
|
||||||
|
|
||||||
if (bs == target) {
|
if (bs == target) {
|
||||||
error_setg(errp, "Source and target cannot be the same");
|
error_setg(errp, "Source and target cannot be the same");
|
||||||
|
|
|
@ -110,6 +110,7 @@ void *block_job_create(const BlockJobDriver *driver, BlockDriverState *bs,
|
||||||
BlockBackend *blk;
|
BlockBackend *blk;
|
||||||
BlockJob *job;
|
BlockJob *job;
|
||||||
|
|
||||||
|
assert(cb);
|
||||||
if (bs->job) {
|
if (bs->job) {
|
||||||
error_setg(errp, QERR_DEVICE_IN_USE, bdrv_get_device_name(bs));
|
error_setg(errp, QERR_DEVICE_IN_USE, bdrv_get_device_name(bs));
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
Loading…
Reference in a new issue