qemu/0132-migration-detect-error-before-sleeping.patch
Cole Robinson a7b9285033 Update to qemu stable 1.4.2
Alias qemu-system-* man page to qemu.1 (bz #907746)
Drop execute bit on service files (bz #963917)
Conditionalize KSM service on host virt support (bz #963681)
Split out KSM package, make it not pulled in by default
2013-05-25 15:13:26 -04:00

40 lines
1.4 KiB
Diff

From 409d6af88505169acec3bf3ae005eba79a981688 Mon Sep 17 00:00:00 2001
From: Paolo Bonzini <pbonzini@redhat.com>
Date: Fri, 22 Feb 2013 17:36:33 +0100
Subject: [PATCH] migration: detect error before sleeping
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>
(cherry picked from commit fd45ee2c643bb3d55de5c54b50c23859ca631a9f)
---
migration.c | 7 ++++---
1 file changed, 4 insertions(+), 3 deletions(-)
diff --git a/migration.c b/migration.c
index a888f36..35c3455 100644
--- a/migration.c
+++ b/migration.c
@@ -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;
@@ -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();