[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH 02/11] migration: simplify state assignmente
From: |
Juan Quintela |
Subject: |
[Qemu-devel] [PATCH 02/11] migration: simplify state assignmente |
Date: |
Fri, 23 Sep 2011 14:50:38 +0200 |
Once there, make sure that if we already know that there is one error, just
call migration_fd_cleanup() with the ERROR state.
Signed-off-by: Juan Quintela <address@hidden>
---
migration.c | 11 ++++-------
1 files changed, 4 insertions(+), 7 deletions(-)
diff --git a/migration.c b/migration.c
index 7dd8f4e..531fe83 100644
--- a/migration.c
+++ b/migration.c
@@ -371,7 +371,6 @@ void migrate_fd_put_ready(void *opaque)
DPRINTF("iterate\n");
if (qemu_savevm_state_iterate(s->mon, s->file) == 1) {
- int state;
int old_vm_running = runstate_is_running();
DPRINTF("done iterating\n");
@@ -381,20 +380,18 @@ void migrate_fd_put_ready(void *opaque)
if (old_vm_running) {
vm_start();
}
- state = MIG_STATE_ERROR;
- } else {
- state = MIG_STATE_COMPLETED;
+ s->state = MIG_STATE_ERROR;
}
if (migrate_fd_cleanup(s) < 0) {
if (old_vm_running) {
vm_start();
}
- state = MIG_STATE_ERROR;
+ s->state = MIG_STATE_ERROR;
}
- if (state == MIG_STATE_COMPLETED) {
+ if (s->state == MIG_STATE_ACTIVE) {
+ s->state = MIG_STATE_COMPLETED;
runstate_set(RSTATE_POST_MIGRATE);
}
- s->state = state;
notifier_list_notify(&migration_state_notifiers, NULL);
}
}
--
1.7.6.2
- [Qemu-devel] [PATCH v2 00/11] Handle errors during migration, Juan Quintela, 2011/09/23
- [Qemu-devel] [PATCH 01/11] ds1225y: Use stdio instead of QEMUFile, Juan Quintela, 2011/09/23
- [Qemu-devel] [PATCH 02/11] migration: simplify state assignmente,
Juan Quintela <=
- [Qemu-devel] [PATCH 06/11] migration: If there is one error, it makes no sense to continue, Juan Quintela, 2011/09/23
- [Qemu-devel] [PATCH 04/11] migration: return real error code, Juan Quintela, 2011/09/23
- [Qemu-devel] [PATCH 03/11] migration: Check that migration is active before cancel it, Juan Quintela, 2011/09/23
- [Qemu-devel] [PATCH 07/11] buffered_file: Use right "opaque", Juan Quintela, 2011/09/23
- [Qemu-devel] [PATCH 09/11] migration: don't "write" when migration is not active, Juan Quintela, 2011/09/23
- [Qemu-devel] [PATCH 10/11] migration: set error if select return one error, Juan Quintela, 2011/09/23
- [Qemu-devel] [PATCH 08/11] buffered_file: reuse QEMUFile has_error field, Juan Quintela, 2011/09/23
- [Qemu-devel] [PATCH 05/11] migration: add error handling to migrate_fd_put_notify()., Juan Quintela, 2011/09/23