qemu-devel
[Top][All Lists]
Advanced

[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.



reply via email to

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