summaryrefslogtreecommitdiffstats
path: root/qemu
diff options
context:
space:
mode:
authorDon Dugger <donald.d.dugger@intel.com>2015-10-29 08:05:08 +0000
committerGerrit Code Review <gerrit@172.30.200.206>2015-10-29 08:05:08 +0000
commit41f827bfbb10e03c4d228fbcc801dd51fb9983b0 (patch)
tree43bca85276fd8b4df857998e2e0af842a87c2a69 /qemu
parent342fa5dfa053559f47caad657132522496dcf1b3 (diff)
parent738df5b97312bb61617669250ce67073108de070 (diff)
Merge "migration: do cleanup operation after completion"
Diffstat (limited to 'qemu')
-rw-r--r--qemu/migration/block.c1
-rw-r--r--qemu/migration/migration.c14
-rw-r--r--qemu/migration/ram.c1
3 files changed, 7 insertions, 9 deletions
diff --git a/qemu/migration/block.c b/qemu/migration/block.c
index ed865ed23..85496fd80 100644
--- a/qemu/migration/block.c
+++ b/qemu/migration/block.c
@@ -750,7 +750,6 @@ static int block_save_complete(QEMUFile *f, void *opaque)
qemu_put_be64(f, BLK_MIG_FLAG_EOS);
- blk_mig_cleanup();
return 0;
}
diff --git a/qemu/migration/migration.c b/qemu/migration/migration.c
index 662e77e4e..4ddb9adce 100644
--- a/qemu/migration/migration.c
+++ b/qemu/migration/migration.c
@@ -560,12 +560,9 @@ static void migrate_fd_cleanup(void *opaque)
assert(s->state != MIGRATION_STATUS_ACTIVE);
- if (s->state != MIGRATION_STATUS_COMPLETED) {
- qemu_savevm_state_cancel();
- if (s->state == MIGRATION_STATUS_CANCELLING) {
- migrate_set_state(s, MIGRATION_STATUS_CANCELLING,
- MIGRATION_STATUS_CANCELLED);
- }
+ if (s->state == MIGRATION_STATUS_CANCELLING) {
+ migrate_set_state(s, MIGRATION_STATUS_CANCELLING,
+ MIGRATION_STATUS_CANCELLED);
}
notifier_list_notify(&migration_state_notifiers, s);
@@ -923,6 +920,7 @@ static void *migration_thread(void *opaque)
int64_t initial_bytes = 0;
int64_t max_size = 0;
int64_t start_time = initial_time;
+ int64_t end_time;
bool old_vm_running = false;
rcu_register_thread();
@@ -1007,9 +1005,11 @@ static void *migration_thread(void *opaque)
}
}
+ end_time = qemu_clock_get_ms(QEMU_CLOCK_REALTIME);
+
qemu_mutex_lock_iothread();
+ qemu_savevm_state_cancel();
if (s->state == MIGRATION_STATUS_COMPLETED) {
- int64_t end_time = qemu_clock_get_ms(QEMU_CLOCK_REALTIME);
uint64_t transferred_bytes = qemu_ftell(s->file);
s->total_time = end_time - s->total_time;
s->downtime = end_time - start_time;
diff --git a/qemu/migration/ram.c b/qemu/migration/ram.c
index 7f007e643..6249f6e60 100644
--- a/qemu/migration/ram.c
+++ b/qemu/migration/ram.c
@@ -1269,7 +1269,6 @@ static int ram_save_complete(QEMUFile *f, void *opaque)
rcu_read_unlock();
- migration_end();
qemu_put_be64(f, RAM_SAVE_FLAG_EOS);
return 0;