On 2018-05-09 18:26, Kevin Wolf wrote: > This moves reference counting from BlockJob to Job. > > In order to keep calling the BlockJob cleanup code when the job is > deleted via job_unref(), introduce a new JobDriver.free callback. Every > block job must use block_job_free() for this callback, this is asserted > in block_job_create(). > > Signed-off-by: Kevin Wolf > --- > include/block/blockjob.h | 21 ------------------- > include/block/blockjob_int.h | 7 +++++++ > include/qemu/job.h | 19 ++++++++++++++++-- > block/backup.c | 1 + > block/commit.c | 1 + > block/mirror.c | 2 ++ > block/stream.c | 1 + > blockjob.c | 48 +++++++++++++++++++------------------------- > job.c | 22 ++++++++++++++++---- > qemu-img.c | 4 ++-- > tests/test-bdrv-drain.c | 1 + > tests/test-blockjob-txn.c | 1 + > tests/test-blockjob.c | 6 ++++-- > 13 files changed, 76 insertions(+), 58 deletions(-) Reviewed-by: Max Reitz