[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.
pgppihFUCJRh4.pgp
Description: PGP signature
[Qemu-devel] [PATCH v4 03/11] block: rename BlkTransactionState and BdrvActionOps, John Snow, 2015/05/11
[Qemu-devel] [PATCH v4 07/11] block: add delayed bitmap successor cleanup, John Snow, 2015/05/11
[Qemu-devel] [PATCH v4 08/11] qmp: Add an implementation wrapper for qmp_drive_backup, John Snow, 2015/05/11
[Qemu-devel] [PATCH v4 05/11] block: add transactional callbacks feature, John Snow, 2015/05/11