[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH v2 05/11] migration: omit drive ref as we have b
From: |
Stefan Hajnoczi |
Subject: |
Re: [Qemu-devel] [PATCH v2 05/11] migration: omit drive ref as we have bdrv_ref now |
Date: |
Tue, 23 Jul 2013 11:49:01 +0200 |
User-agent: |
Mutt/1.5.21 (2010-09-15) |
On Wed, Jul 17, 2013 at 05:42:10PM +0800, Fam Zheng wrote:
> Signed-off-by: Fam Zheng <address@hidden>
> ---
> block-migration.c | 2 --
> 1 file changed, 2 deletions(-)
>
> diff --git a/block-migration.c b/block-migration.c
> index d558410..d14f4eb 100644
> --- a/block-migration.c
> +++ b/block-migration.c
> @@ -320,7 +320,6 @@ static void init_blk_migration_it(void *opaque,
> BlockDriverState *bs)
> bmds->completed_sectors = 0;
> bmds->shared_base = block_mig_state.shared_base;
> alloc_aio_bitmap(bmds);
> - drive_get_ref(drive_get_by_blockdev(bs));
> bdrv_ref(bs, true);
>
> block_mig_state.total_sector_sum += sectors;
> @@ -558,7 +557,6 @@ static void blk_mig_cleanup(void)
> while ((bmds = QSIMPLEQ_FIRST(&block_mig_state.bmds_list)) != NULL) {
> QSIMPLEQ_REMOVE_HEAD(&block_mig_state.bmds_list, entry);
> bdrv_unref(bmds->bs, true);
> - drive_put_ref(drive_get_by_blockdev(bmds->bs));
> g_free(bmds->aio_bitmap);
> g_free(bmds);
> }
> --
> 1.8.3.2
The key information here is that block-migration.c does not actually use
DriveInfo anywhere. Hence it's safe to drop this code since we really
only cared about referencing BDS.
I suggest including an explanation like this in the commit description.
I had to audit the code to check whether the DriveInfo was used anywhere
else.
- Re: [Qemu-devel] [PATCH v2 01/11] block: replace in_use with refcnt_soft and refcnt_hard, (continued)
- Re: [Qemu-devel] [PATCH v2 01/11] block: replace in_use with refcnt_soft and refcnt_hard, Stefan Hajnoczi, 2013/07/23
- Re: [Qemu-devel] [PATCH v2 01/11] block: replace in_use with refcnt_soft and refcnt_hard, Fam Zheng, 2013/07/23
- Re: [Qemu-devel] [PATCH v2 01/11] block: replace in_use with refcnt_soft and refcnt_hard, Stefan Hajnoczi, 2013/07/24
- Re: [Qemu-devel] [PATCH v2 01/11] block: replace in_use with refcnt_soft and refcnt_hard, Fam Zheng, 2013/07/24
- Re: [Qemu-devel] [PATCH v2 01/11] block: replace in_use with refcnt_soft and refcnt_hard, Stefan Hajnoczi, 2013/07/25
[Qemu-devel] [PATCH v2 02/11] block: use refcnt for bs->backing_hd and bs->file, Fam Zheng, 2013/07/17
[Qemu-devel] [PATCH v2 03/11] block: use refcnt for drive_init/drive_uninit, Fam Zheng, 2013/07/17
[Qemu-devel] [PATCH v2 04/11] block: use refcnt for device attach/detach, Fam Zheng, 2013/07/17
[Qemu-devel] [PATCH v2 05/11] migration: omit drive ref as we have bdrv_ref now, Fam Zheng, 2013/07/17
- Re: [Qemu-devel] [PATCH v2 05/11] migration: omit drive ref as we have bdrv_ref now,
Stefan Hajnoczi <=
[Qemu-devel] [PATCH v2 06/11] xen_disk: simplify blk_disconnect with refcnt, Fam Zheng, 2013/07/17
[Qemu-devel] [PATCH v2 07/11] block: hold hard reference for backup/mirror target, Fam Zheng, 2013/07/17
[Qemu-devel] [PATCH v2 08/11] block: simplify bdrv_drop_intermediate, Fam Zheng, 2013/07/17
[Qemu-devel] [PATCH v2 09/11] block: add assertion to check refcount before deleting, Fam Zheng, 2013/07/17