[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH 1/7] migration: simplify state assignmente
From: |
Juan Quintela |
Subject: |
[Qemu-devel] [PATCH 1/7] migration: simplify state assignmente |
Date: |
Tue, 20 Sep 2011 15:24:40 +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, 5 insertions(+), 6 deletions(-)
diff --git a/migration.c b/migration.c
index f5959b4..9a93e3b 100644
--- a/migration.c
+++ b/migration.c
@@ -370,7 +370,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 = vm_running;
DPRINTF("done iterating\n");
@@ -380,17 +379,17 @@ 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 (s->state == MIG_STATE_ACTIVE) {
+ s->state = MIG_STATE_COMPLETED;
}
- s->state = state;
notifier_list_notify(&migration_state_notifiers, NULL);
}
}
--
1.7.6.2
- [Qemu-devel] [PATCH 0/7] Handle errors during migration, Juan Quintela, 2011/09/20
- [Qemu-devel] [PATCH 3/7] migration: Check that migration is active before cancel it, Juan Quintela, 2011/09/20
- [Qemu-devel] [PATCH 2/7] migration: only flush when there are no errors, Juan Quintela, 2011/09/20
- [Qemu-devel] [PATCH 1/7] migration: simplify state assignmente,
Juan Quintela <=
- [Qemu-devel] [PATCH 7/7] migration: qemu_savevm_iterate has three return values, Juan Quintela, 2011/09/20
- [Qemu-devel] [PATCH 6/7] migration: If there is one error, it makes no sense to continue, Juan Quintela, 2011/09/20
- [Qemu-devel] [PATCH 5/7] migration: add error handling to migrate_fd_put_notify()., Juan Quintela, 2011/09/20
- [Qemu-devel] [PATCH 4/7] savevm: avoid qemu_savevm_state_iterate() to return 1 when qemu file has error., Juan Quintela, 2011/09/20