migration/dirty-bitmaps: change bitmap enumeration method
RFC PATCH 1/1 migration/dirty-bitmaps: change bitmap enumeration method
Shift from looking at every root BDS to *every* BDS. Tested only lightly via iotests.
Counter-examples that break this approach welcome.
--- migration/block-dirty-bitmap.c | 14 ++++---------- 1 file changed, 4 insertions(+), 10 deletions(-)
migration/block-dirty-bitmap.c +4 -10
@@ -273,7 +273,6 @@ static int init_dirty_bitmap_migration(void)BlockDriverState *bs;BdrvDirtyBitmap *bitmap;DirtyBitmapMigBitmapState *dbms; -BdrvNextIterator it;Error *local_err =NULL ; dirty_bitmap_mig_state.bulk_completed = false;
@@ -281,13 +280,8 @@ static int init_dirty_bitmap_migration(void) dirty_bitmap_mig_state.prev_bitmap =NULL ; dirty_bitmap_mig_state.no_bitmaps = false; -for (bs =bdrv_first (&it); bs; bs =bdrv_next (&it)) { -const char *drive_name =bdrv_get_device_or_node_name (bs); - -/* skip automatically inserted nodes */ -while (bs && bs->drv && bs->implicit) { - bs =backing_bs (bs); - } +for (bs =bdrv_next_all_states (NULL ); bs; bs =bdrv_next_all_states (bs)) { +const char *name =bdrv_get_device_or_node_name (bs);for (bitmap =bdrv_dirty_bitmap_next (bs,NULL ); bitmap; bitmap =bdrv_dirty_bitmap_next (bs, bitmap))
@@ -296,7 +290,7 @@ static int init_dirty_bitmap_migration(void)continue ; } -if (drive_name ==NULL ) { +if (!name ||strcmp (name,"" ) ==0 ) {error_report ("Found bitmap '%s' in unnamed node %p. It can't " "be migrated" ,bdrv_dirty_bitmap_name (bitmap), bs); goto fail;
@@ -313,7 +307,7 @@ static int init_dirty_bitmap_migration(void) dbms =g_new0 (DirtyBitmapMigBitmapState,1 ); dbms->bs = bs; - dbms->node_name = drive_name; + dbms->node_name = name; dbms->bitmap = bitmap; dbms->total_sectors =bdrv_nb_sectors (bs); dbms->sectors_per_chunk = CHUNK_SIZE * 8 *
Signature · 1 line
2.20.1
Patchew URL: https://patchew.org/QEMU/[email protected]/
Patchew URL: https://patchew.org/QEMU/[email protected]/
Hi,
This series seems to have some coding style problems. See output below for more information:
Type: series
Message-id: [email protected]
Subject: [Qemu-devel] [PATCH RFC] migration/dirty-bitmaps: change bitmap enumeration method
=== TEST SCRIPT BEGIN ===
#!/bin/bash
git rev-parse base > /dev/null || exit 0
git config --local diff.renamelimit 0
git config --local diff.renames True
git config --local diff.algorithm histogram./scripts/checkpatch.pl --mailback base..
=== TEST SCRIPT END ===
Updating 3c8cf5a9c21ff8782164d1def7f44bd888713384
From https://github.com/patchew-project/qemu
t [tag update] patchew/[email protected] -> patchew/[email protected]
* [new tag] patchew/[email protected] -> patchew/[email protected]
Switched to a new branch 'test'6c45c3fbd4 migration/dirty-bitmaps: change bitmap enumeration method
=== OUTPUT BEGIN ===
ERROR: Missing Signed-off-by: line(s)
total: 1 errors, 0 warnings, 38 lines checked
Commit 6c45c3fbd47d (migration/dirty-bitmaps: change bitmap enumeration method) has style problems, please review. If any of these errors are false positives report them to the maintainer, see
CHECKPATCH in MAINTAINERS.
=== OUTPUT END ===
Test command exited with code: 1
The full log is available at
http://patchew.org/logs/[email protected]/testing.checkpatch/?type=message.
---
Email generated automatically by Patchew [https://patchew.org/].
Please send your feedback to [email protected]