aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPeter Xu <peterx@redhat.com>2024-12-06 18:08:34 -0500
committerFabiano Rosas <farosas@suse.de>2025-01-09 17:38:44 -0300
commite4e5e89bbd8e731e86735d9d25b7b5f49e8f08b6 (patch)
tree31dfa796d38c370aa339ffc5ffa8d07fea2c2169
parent7815f69867da92335055d4b5248430b0f122ce4e (diff)
downloadqemu-e4e5e89bbd8e731e86735d9d25b7b5f49e8f08b6.zip
qemu-e4e5e89bbd8e731e86735d9d25b7b5f49e8f08b6.tar.gz
qemu-e4e5e89bbd8e731e86735d9d25b7b5f49e8f08b6.tar.bz2
qmp/cont: Only activate disks if migration completed
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> Reviewed-by: Fabiano Rosas <farosas@suse.de> Message-Id: <20241206230838.1111496-3-peterx@redhat.com> Signed-off-by: Fabiano Rosas <farosas@suse.de>
-rw-r--r--monitor/qmp-cmds.c26
1 files changed, 14 insertions, 12 deletions
diff --git a/monitor/qmp-cmds.c b/monitor/qmp-cmds.c
index 34f2150..415e645 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();
}
}