Skip to content

Commit

Permalink
migration: omit drive ref as we have bdrv_ref now
Browse files Browse the repository at this point in the history
block-migration.c does not actually use DriveInfo anywhere.  Hence it's
safe to drive ref code, we really only care about referencing BDS.

Signed-off-by: Fam Zheng <[email protected]>
Signed-off-by: Stefan Hajnoczi <[email protected]>
  • Loading branch information
Fam Zheng authored and stefanhaRH committed Sep 6, 2013
1 parent 4f6fd34 commit 8442cfd
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions block-migration.c
Original file line number Diff line number Diff line change
Expand Up @@ -336,8 +336,8 @@ 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_set_in_use(bs, 1);
bdrv_ref(bs);

block_mig_state.total_sector_sum += sectors;

Expand Down Expand Up @@ -575,7 +575,7 @@ 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_set_in_use(bmds->bs, 0);
drive_put_ref(drive_get_by_blockdev(bmds->bs));
bdrv_unref(bmds->bs);
g_free(bmds->aio_bitmap);
g_free(bmds);
}
Expand Down

0 comments on commit 8442cfd

Please sign in to comment.