Skip to content

Commit 61f2b48

Browse files
xzpeterFabiano Rosas
authored andcommitted
migration/block: Apply late-block-active behavior to postcopy
Postcopy never cared about late-block-active. However there's no mention in the capability that it doesn't apply to postcopy. Considering that we _assumed_ late activation is always good, do that too for postcopy unconditionally, just like precopy. After this patch, we should have unified the behavior across all. Signed-off-by: Peter Xu <[email protected]> Reviewed-by: Fabiano Rosas <[email protected]> Message-Id: <[email protected]> Signed-off-by: Fabiano Rosas <[email protected]>
1 parent fca9aef commit 61f2b48

File tree

1 file changed

+12
-13
lines changed

1 file changed

+12
-13
lines changed

migration/savevm.c

Lines changed: 12 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -2137,22 +2137,21 @@ static void loadvm_postcopy_handle_run_bh(void *opaque)
21372137

21382138
trace_vmstate_downtime_checkpoint("dst-postcopy-bh-announced");
21392139

2140-
/* Make sure all file formats throw away their mutable metadata.
2141-
* If we get an error here, just don't restart the VM yet. */
2142-
bdrv_activate_all(&local_err);
2143-
if (local_err) {
2144-
error_report_err(local_err);
2145-
local_err = NULL;
2146-
autostart = false;
2147-
}
2148-
2149-
trace_vmstate_downtime_checkpoint("dst-postcopy-bh-cache-invalidated");
2150-
21512140
dirty_bitmap_mig_before_vm_start();
21522141

21532142
if (autostart) {
2154-
/* Hold onto your hats, starting the CPU */
2155-
vm_start();
2143+
/*
2144+
* Make sure all file formats throw away their mutable metadata.
2145+
* If we get an error here, just don't restart the VM yet.
2146+
*/
2147+
bdrv_activate_all(&local_err);
2148+
trace_vmstate_downtime_checkpoint("dst-postcopy-bh-cache-invalidated");
2149+
if (local_err) {
2150+
error_report_err(local_err);
2151+
local_err = NULL;
2152+
} else {
2153+
vm_start();
2154+
}
21562155
} else {
21572156
/* leave it paused and let management decide when to start the CPU */
21582157
runstate_set(RUN_STATE_PAUSED);

0 commit comments

Comments
 (0)