From: Changlong Xie <[email protected]> Callback for block job should always exist
Suggested-by: Paolo Bonzini <[email protected]> Suggested-by: Kevin Wolf <[email protected]> Signed-off-by: Changlong Xie <[email protected]> Reviewed-by: Fam Zheng <[email protected]> Reviewed-by: Stefan Hajnoczi <[email protected]> Reviewed-by: Jeff Cody <[email protected]> Message-id: [email protected] Signed-off-by: Jeff Cody <[email protected]> --- block/backup.c | 1 - blockjob.c | 1 + 2 files changed, 1 insertion(+), 1 deletion(-) diff --git a/block/backup.c b/block/backup.c index 581269b..f87f8d5 100644 --- a/block/backup.c +++ b/block/backup.c @@ -489,7 +489,6 @@ void backup_start(BlockDriverState *bs, BlockDriverState *target, assert(bs); assert(target); - assert(cb); if (bs == target) { error_setg(errp, "Source and target cannot be the same"); diff --git a/blockjob.c b/blockjob.c index 90c4e26..205da9d 100644 --- a/blockjob.c +++ b/blockjob.c @@ -110,6 +110,7 @@ void *block_job_create(const BlockJobDriver *driver, BlockDriverState *bs, BlockBackend *blk; BlockJob *job; + assert(cb); if (bs->job) { error_setg(errp, QERR_DEVICE_IN_USE, bdrv_get_device_name(bs)); return NULL; -- 1.9.3
