On Mon, May 11, 2015 at 07:04:21PM -0400, John Snow wrote: > If we want to get at the job after the life of the job, > we'll need a refcount for this object. > > This may occur for example if we wish to inspect the actions > taken by a particular job after a transactional group of jobs > runs, and further actions are required. > > Signed-off-by: John Snow <js...@redhat.com> > Reviewed-by: Max Reitz <mre...@redhat.com> > --- > blockjob.c | 18 ++++++++++++++++-- > include/block/blockjob.h | 21 +++++++++++++++++++++ > 2 files changed, 37 insertions(+), 2 deletions(-)
I think the only reason for this refcount is so that backup_transaction_complete() can be called. It accesses BackupBlockJob->sync_bitmap so the BackupBlockJob instance needs to be alive. The bitmap refcount is incremented in blockdev.c, not block/backup.c, so it is fine to drop backup_transaction_complete() and decrement the bitmap refcount in blockdev.c instead. If you do that then there is no need to add a refcount to block job. This would simplify things.
pgpooeh7qM9TI.pgp
Description: PGP signature