aboutsummaryrefslogtreecommitdiff
path: root/block-migration.c
diff options
context:
space:
mode:
authorMarkus Armbruster <armbru@redhat.com>2014-10-07 13:59:10 +0200
committerKevin Wolf <kwolf@redhat.com>2014-10-20 13:41:26 +0200
commitfea68bb6e9fa65c7cc6caa6adda810d1d0fdbde4 (patch)
treea7e6e95a740ae028023b921b7048b9fd3bfa4297 /block-migration.c
parentb9fe8a7a12f18adebba5616a3e9f44143a78c07e (diff)
block: Eliminate bdrv_iterate(), use bdrv_next()
Signed-off-by: Markus Armbruster <armbru@redhat.com> Reviewed-by: BenoƮt Canet <benoit.canet@nodalink.com> Reviewed-by: Max Reitz <mreitz@redhat.com> Reviewed-by: Kevin Wolf <kwolf@redhat.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Diffstat (limited to 'block-migration.c')
-rw-r--r--block-migration.c30
1 files changed, 15 insertions, 15 deletions
diff --git a/block-migration.c b/block-migration.c
index 3ad31a2c70..cb3e16c9d9 100644
--- a/block-migration.c
+++ b/block-migration.c
@@ -343,12 +343,25 @@ static void unset_dirty_tracking(void)
}
}
-static void init_blk_migration_it(void *opaque, BlockDriverState *bs)
+static void init_blk_migration(QEMUFile *f)
{
+ BlockDriverState *bs;
BlkMigDevState *bmds;
int64_t sectors;
- if (!bdrv_is_read_only(bs)) {
+ block_mig_state.submitted = 0;
+ block_mig_state.read_done = 0;
+ block_mig_state.transferred = 0;
+ block_mig_state.total_sector_sum = 0;
+ block_mig_state.prev_progress = -1;
+ block_mig_state.bulk_completed = 0;
+ block_mig_state.zero_blocks = migrate_zero_blocks();
+
+ for (bs = bdrv_next(NULL); bs; bs = bdrv_next(bs)) {
+ if (bdrv_is_read_only(bs)) {
+ continue;
+ }
+
sectors = bdrv_nb_sectors(bs);
if (sectors <= 0) {
return;
@@ -378,19 +391,6 @@ static void init_blk_migration_it(void *opaque, BlockDriverState *bs)
}
}
-static void init_blk_migration(QEMUFile *f)
-{
- block_mig_state.submitted = 0;
- block_mig_state.read_done = 0;
- block_mig_state.transferred = 0;
- block_mig_state.total_sector_sum = 0;
- block_mig_state.prev_progress = -1;
- block_mig_state.bulk_completed = 0;
- block_mig_state.zero_blocks = migrate_zero_blocks();
-
- bdrv_iterate(init_blk_migration_it, NULL);
-}
-
/* Called with no lock taken. */
static int blk_mig_save_bulked_block(QEMUFile *f)