diff options
author | Anthony Liguori <aliguori@us.ibm.com> | 2013-07-15 14:00:32 -0500 |
---|---|---|
committer | Anthony Liguori <aliguori@us.ibm.com> | 2013-07-15 14:00:32 -0500 |
commit | 5699a02e01a4d046652bc6e77abd67e887ae209c (patch) | |
tree | 9b5f353025bb767ad0fbf10fc9d6488be7831b13 /migration.c | |
parent | c3cb8e77804313e1be99b5f28a34a346736707a5 (diff) | |
parent | a62eaa26c1d6d48fbdc3ac1d32bd1314f5fdc8c9 (diff) |
Merge remote-tracking branch 'kwolf/for-anthony' into staging
# By Kevin Wolf (6) and Stefan Hajnoczi (2)
# Via Kevin Wolf
* kwolf/for-anthony:
ahci: Fix FLUSH command
migration: Fail migration on bdrv_flush_all() error
cpus: Add return value for vm_stop()
block: Add return value for bdrv_flush_all()
qemu-iotests: Update 051 reference output
block: Don't parse protocol from file.filename
block: add drive_backup HMP command
blockdev: add sync mode to drive-backup QMP command
Message-id: 1373887000-4488-1-git-send-email-kwolf@redhat.com
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Diffstat (limited to 'migration.c')
-rw-r--r-- | migration.c | 17 |
1 files changed, 14 insertions, 3 deletions
diff --git a/migration.c b/migration.c index 635a7e7a08..0681d8e5f1 100644 --- a/migration.c +++ b/migration.c @@ -527,15 +527,26 @@ static void *migration_thread(void *opaque) if (pending_size && pending_size >= max_size) { qemu_savevm_state_iterate(s->file); } else { + int ret; + DPRINTF("done iterating\n"); qemu_mutex_lock_iothread(); start_time = qemu_get_clock_ms(rt_clock); qemu_system_wakeup_request(QEMU_WAKEUP_REASON_OTHER); old_vm_running = runstate_is_running(); - vm_stop_force_state(RUN_STATE_FINISH_MIGRATE); - qemu_file_set_rate_limit(s->file, INT_MAX); - qemu_savevm_state_complete(s->file); + + ret = vm_stop_force_state(RUN_STATE_FINISH_MIGRATE); + if (ret >= 0) { + qemu_file_set_rate_limit(s->file, INT_MAX); + qemu_savevm_state_complete(s->file); + } qemu_mutex_unlock_iothread(); + + if (ret < 0) { + migrate_finish_set_state(s, MIG_STATE_ERROR); + break; + } + if (!qemu_file_get_error(s->file)) { migrate_finish_set_state(s, MIG_STATE_COMPLETED); break; |