Commit eeb34af986c28b8da4001d947d66e2efaaad0e66
1 parent
1889465a
Make sure to only vm_start() a failed migration if we were running to begin
with. Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Showing
1 changed file
with
5 additions
and
1 deletions
migration.c
... | ... | @@ -261,12 +261,16 @@ void migrate_fd_put_ready(void *opaque) |
261 | 261 | dprintf("iterate\n"); |
262 | 262 | if (qemu_savevm_state_iterate(s->file) == 1) { |
263 | 263 | int state; |
264 | + int old_vm_running = vm_running; | |
265 | + | |
264 | 266 | dprintf("done iterating\n"); |
265 | 267 | vm_stop(0); |
266 | 268 | |
267 | 269 | bdrv_flush_all(); |
268 | 270 | if ((qemu_savevm_state_complete(s->file)) < 0) { |
269 | - vm_start(); | |
271 | + if (old_vm_running) { | |
272 | + vm_start(); | |
273 | + } | |
270 | 274 | state = MIG_STATE_ERROR; |
271 | 275 | } else { |
272 | 276 | state = MIG_STATE_COMPLETED; | ... | ... |