Signed-off-by: Emanuele Giuseppe Esposito <eespo...@redhat.com> Reviewed-by: Stefan Hajnoczi <stefa...@redhat.com> --- blockjob.c | 4 ++++ 1 file changed, 4 insertions(+)
diff --git a/blockjob.c b/blockjob.c index 4bad1408cb..10c807413e 100644 --- a/blockjob.c +++ b/blockjob.c @@ -84,6 +84,7 @@ BlockJob *block_job_get(const char *id) void block_job_free(Job *job) { BlockJob *bjob = container_of(job, BlockJob, job); + assert(qemu_in_main_thread()); block_job_remove_all_bdrv(bjob); blk_unref(bjob->blk); @@ -436,6 +437,8 @@ void *block_job_create(const char *job_id, const BlockJobDriver *driver, BlockBackend *blk; BlockJob *job; + assert(qemu_in_main_thread()); + if (job_id == NULL && !(flags & JOB_INTERNAL)) { job_id = bdrv_get_device_name(bs); } @@ -505,6 +508,7 @@ void block_job_iostatus_reset(BlockJob *job) void block_job_user_resume(Job *job) { BlockJob *bjob = container_of(job, BlockJob, job); + assert(qemu_in_main_thread()); block_job_iostatus_reset(bjob); } -- 2.27.0