Skip to content

Commit e4e5e89

Browse files
xzpeterFabiano Rosas
authored andcommitted
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 <[email protected]> Cc: Markus Armbruster <[email protected]> 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 7815f69 commit e4e5e89

File tree

1 file changed

+14
-12
lines changed

1 file changed

+14
-12
lines changed

monitor/qmp-cmds.c

Lines changed: 14 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -96,21 +96,23 @@ void qmp_cont(Error **errp)
9696
}
9797
}
9898

99-
/* Continuing after completed migration. Images have been inactivated to
100-
* allow the destination to take control. Need to get control back now.
101-
*
102-
* If there are no inactive block nodes (e.g. because the VM was just
103-
* paused rather than completing a migration), bdrv_inactivate_all() simply
104-
* doesn't do anything. */
105-
bdrv_activate_all(&local_err);
106-
if (local_err) {
107-
error_propagate(errp, local_err);
108-
return;
109-
}
110-
11199
if (runstate_check(RUN_STATE_INMIGRATE)) {
112100
autostart = 1;
113101
} else {
102+
/*
103+
* Continuing after completed migration. Images have been
104+
* inactivated to allow the destination to take control. Need to
105+
* get control back now.
106+
*
107+
* If there are no inactive block nodes (e.g. because the VM was
108+
* just paused rather than completing a migration),
109+
* bdrv_inactivate_all() simply doesn't do anything.
110+
*/
111+
bdrv_activate_all(&local_err);
112+
if (local_err) {
113+
error_propagate(errp, local_err);
114+
return;
115+
}
114116
vm_start();
115117
}
116118
}

0 commit comments

Comments
 (0)