qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH v4 06/11] block: add refcount to Job object


From: Stefan Hajnoczi
Subject: Re: [Qemu-devel] [PATCH v4 06/11] block: add refcount to Job object
Date: Mon, 18 May 2015 16:45:59 +0100
User-agent: Mutt/1.5.23 (2014-03-12)

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 <address@hidden>
> Reviewed-by: Max Reitz <address@hidden>
> ---
>  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.

Attachment: pgppihFUCJRh4.pgp
Description: PGP signature


reply via email to

[Prev in Thread] Current Thread [Next in Thread]