[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH v2 2/6] qmp/cont: Only activate disks if migration completed
From: |
Peter Xu |
Subject: |
[PATCH v2 2/6] qmp/cont: Only activate disks if migration completed |
Date: |
Fri, 6 Dec 2024 18:08:34 -0500 |
As the comment says, the activation of disks is for the case where
migration has completed, rather than when QEMU is still during
migration (RUN_STATE_INMIGRATE).
Move the code over to reflect what the comment is describing.
Cc: Kevin Wolf <kwolf@redhat.com>
Cc: Markus Armbruster <armbru@redhat.com>
Signed-off-by: Peter Xu <peterx@redhat.com>
---
monitor/qmp-cmds.c | 26 ++++++++++++++------------
1 file changed, 14 insertions(+), 12 deletions(-)
diff --git a/monitor/qmp-cmds.c b/monitor/qmp-cmds.c
index f84a0dc523..76f21e8af3 100644
--- a/monitor/qmp-cmds.c
+++ b/monitor/qmp-cmds.c
@@ -96,21 +96,23 @@ void qmp_cont(Error **errp)
}
}
- /* Continuing after completed migration. Images have been inactivated to
- * allow the destination to take control. Need to get control back now.
- *
- * If there are no inactive block nodes (e.g. because the VM was just
- * paused rather than completing a migration), bdrv_inactivate_all() simply
- * doesn't do anything. */
- bdrv_activate_all(&local_err);
- if (local_err) {
- error_propagate(errp, local_err);
- return;
- }
-
if (runstate_check(RUN_STATE_INMIGRATE)) {
autostart = 1;
} else {
+ /*
+ * Continuing after completed migration. Images have been
+ * inactivated to allow the destination to take control. Need to
+ * get control back now.
+ *
+ * If there are no inactive block nodes (e.g. because the VM was
+ * just paused rather than completing a migration),
+ * bdrv_inactivate_all() simply doesn't do anything.
+ */
+ bdrv_activate_all(&local_err);
+ if (local_err) {
+ error_propagate(errp, local_err);
+ return;
+ }
vm_start();
}
}
--
2.47.0
- [PATCH v2 0/6] migration/block: disk activation rewrite, Peter Xu, 2024/12/06
- [PATCH v2 1/6] migration: Add helper to get target runstate, Peter Xu, 2024/12/06
- [PATCH v2 2/6] qmp/cont: Only activate disks if migration completed,
Peter Xu <=
- [PATCH v2 3/6] migration/block: Make late-block-active the default, Peter Xu, 2024/12/06
- [PATCH v2 4/6] migration/block: Apply late-block-active behavior to postcopy, Peter Xu, 2024/12/06
- [PATCH v2 5/6] migration/block: Fix possible race with block_inactive, Peter Xu, 2024/12/06
- [PATCH v2 6/6] migration/block: Rewrite disk activation, Peter Xu, 2024/12/06