Skip to content

Commit

Permalink
migration: detect error before sleeping
Browse files Browse the repository at this point in the history
Reviewed-by: Orit Wasserman <owasserm@redhat.com>
Reviewed-by: Juan Quintela <quintela@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Juan Quintela <quintela@redhat.com>
  • Loading branch information
bonzini authored and Juan Quintela committed Mar 11, 2013
1 parent 059f896 commit fd45ee2
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions migration.c
Expand Up @@ -657,6 +657,10 @@ static void *migration_thread(void *opaque)
}
}

if (qemu_file_get_error(s->file)) {
migrate_finish_set_state(s, MIG_STATE_ERROR);
break;
}
current_time = qemu_get_clock_ms(rt_clock);
if (current_time >= initial_time + BUFFER_DELAY) {
uint64_t transferred_bytes = s->bytes_xfer;
Expand All @@ -682,9 +686,6 @@ static void *migration_thread(void *opaque)
g_usleep((initial_time + BUFFER_DELAY - current_time)*1000);
sleep_time += qemu_get_clock_ms(rt_clock) - current_time;
}
if (qemu_file_get_error(s->file)) {
migrate_finish_set_state(s, MIG_STATE_ERROR);
}
}

qemu_mutex_lock_iothread();
Expand Down

0 comments on commit fd45ee2

Please sign in to comment.