All of lore.kernel.org
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH RFC] migration/dirty-bitmaps: change bitmap enumeration method
@ 2019-04-30 23:15 ` John Snow
  0 siblings, 0 replies; 4+ messages in thread
From: John Snow @ 2019-04-30 23:15 UTC (permalink / raw)
  To: qemu-devel
  Cc: qemu-block, Juan Quintela, vsementsov, Dr. David Alan Gilbert,
	Fam Zheng, Stefan Hajnoczi, John Snow

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(-)

diff --git a/migration/block-dirty-bitmap.c b/migration/block-dirty-bitmap.c
index d1bb863cb6..4a896a09eb 100644
--- a/migration/block-dirty-bitmap.c
+++ b/migration/block-dirty-bitmap.c
@@ -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 *
-- 
2.20.1

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* [Qemu-devel] [PATCH RFC] migration/dirty-bitmaps: change bitmap enumeration method
@ 2019-04-30 23:15 ` John Snow
  0 siblings, 0 replies; 4+ messages in thread
From: John Snow @ 2019-04-30 23:15 UTC (permalink / raw)
  To: qemu-devel
  Cc: Fam Zheng, vsementsov, qemu-block, Juan Quintela,
	Dr. David Alan Gilbert, Stefan Hajnoczi, John Snow

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(-)

diff --git a/migration/block-dirty-bitmap.c b/migration/block-dirty-bitmap.c
index d1bb863cb6..4a896a09eb 100644
--- a/migration/block-dirty-bitmap.c
+++ b/migration/block-dirty-bitmap.c
@@ -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 *
-- 
2.20.1



^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [Qemu-devel] [PATCH RFC] migration/dirty-bitmaps: change bitmap enumeration method
@ 2019-04-30 23:34   ` no-reply
  0 siblings, 0 replies; 4+ messages in thread
From: no-reply @ 2019-04-30 23:34 UTC (permalink / raw)
  To: jsnow; +Cc: fam, qemu-devel

Patchew URL: https://patchew.org/QEMU/20190430231536.25353-1-jsnow@redhat.com/



Hi,

This series seems to have some coding style problems. See output below for
more information:

Type: series
Message-id: 20190430231536.25353-1-jsnow@redhat.com
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/20190424103747.10173-1-thuth@redhat.com -> patchew/20190424103747.10173-1-thuth@redhat.com
 * [new tag]               patchew/20190430231536.25353-1-jsnow@redhat.com -> patchew/20190430231536.25353-1-jsnow@redhat.com
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/20190430231536.25353-1-jsnow@redhat.com/testing.checkpatch/?type=message.
---
Email generated automatically by Patchew [https://patchew.org/].
Please send your feedback to patchew-devel@redhat.com

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [Qemu-devel] [PATCH RFC] migration/dirty-bitmaps: change bitmap enumeration method
@ 2019-04-30 23:34   ` no-reply
  0 siblings, 0 replies; 4+ messages in thread
From: no-reply @ 2019-04-30 23:34 UTC (permalink / raw)
  To: jsnow
  Cc: fam, vsementsov, qemu-block, quintela, dgilbert, qemu-devel,
	stefanha, jsnow

Patchew URL: https://patchew.org/QEMU/20190430231536.25353-1-jsnow@redhat.com/



Hi,

This series seems to have some coding style problems. See output below for
more information:

Type: series
Message-id: 20190430231536.25353-1-jsnow@redhat.com
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/20190424103747.10173-1-thuth@redhat.com -> patchew/20190424103747.10173-1-thuth@redhat.com
 * [new tag]               patchew/20190430231536.25353-1-jsnow@redhat.com -> patchew/20190430231536.25353-1-jsnow@redhat.com
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/20190430231536.25353-1-jsnow@redhat.com/testing.checkpatch/?type=message.
---
Email generated automatically by Patchew [https://patchew.org/].
Please send your feedback to patchew-devel@redhat.com

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2019-04-30 23:36 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-04-30 23:15 [Qemu-devel] [PATCH RFC] migration/dirty-bitmaps: change bitmap enumeration method John Snow
2019-04-30 23:15 ` John Snow
2019-04-30 23:34 ` no-reply
2019-04-30 23:34   ` no-reply

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.