migration: Block migration comment or code is wrong
authorJuan Quintela <quintela@redhat.com>
Mon, 3 Oct 2022 03:15:56 +0000 (05:15 +0200)
committerJuan Quintela <quintela@redhat.com>
Mon, 21 Nov 2022 10:58:10 +0000 (11:58 +0100)
And it appears that what is wrong is the code. During bulk stage we
need to make sure that some block is dirty, but no games with
max_size at all.

Signed-off-by: Juan Quintela <quintela@redhat.com>
Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com>
migration/block.c

index 3577c815a947b62286c635d45f108fdfec2e470e..4347da1526a4e333fa2ba352674a530c6996d213 100644 (file)
@@ -880,8 +880,8 @@ static void block_save_pending(QEMUFile *f, void *opaque, uint64_t max_size,
     blk_mig_unlock();
 
     /* Report at least one block pending during bulk phase */
-    if (pending <= max_size && !block_mig_state.bulk_completed) {
-        pending = max_size + BLK_MIG_BLOCK_SIZE;
+    if (!pending && !block_mig_state.bulk_completed) {
+        pending = BLK_MIG_BLOCK_SIZE;
     }
 
     trace_migration_block_save_pending(pending);