[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH 24/36] migration: Introduce migrate_fd_completed() f
From: |
Juan Quintela |
Subject: |
[Qemu-devel] [PATCH 24/36] migration: Introduce migrate_fd_completed() for consistency |
Date: |
Tue, 11 Oct 2011 12:00:44 +0200 |
This function is a bit different of the others that change the state,
in the sense that if migrate_fd_cleanup() returns an error, it set the
status to error, not completed.
Signed-off-by: Juan Quintela <address@hidden>
---
migration.c | 20 +++++++++++++-------
1 files changed, 13 insertions(+), 7 deletions(-)
diff --git a/migration.c b/migration.c
index 432afe6..a8e936e 100644
--- a/migration.c
+++ b/migration.c
@@ -317,6 +317,18 @@ void migrate_fd_error(MigrationState *s)
migrate_fd_cleanup(s);
}
+static void migrate_fd_completed(MigrationState *s)
+{
+ DPRINTF("setting completed state\n");
+ if (migrate_fd_cleanup(s) < 0) {
+ s->state = MIG_STATE_ERROR;
+ } else {
+ s->state = MIG_STATE_COMPLETED;
+ runstate_set(RUN_STATE_POSTMIGRATE);
+ }
+ notifier_list_notify(&migration_state_notifiers, NULL);
+}
+
static void migrate_fd_put_notify(void *opaque)
{
MigrationState *s = opaque;
@@ -375,13 +387,7 @@ static void migrate_fd_put_ready(void *opaque)
if (qemu_savevm_state_complete(s->mon, s->file) < 0) {
migrate_fd_error(s);
} else {
- if (migrate_fd_cleanup(s) < 0) {
- migrate_fd_error(s);
- } else {
- s->state = MIG_STATE_COMPLETED;
- runstate_set(RUN_STATE_POSTMIGRATE);
- notifier_list_notify(&migration_state_notifiers, NULL);
- }
+ migrate_fd_completed(s);
}
if (s->get_status(s) != MIG_STATE_COMPLETED) {
if (old_vm_running) {
--
1.7.6.4
- [Qemu-devel] [PATCH 20/36] migration: Make all posible migration functions static, (continued)
- [Qemu-devel] [PATCH 20/36] migration: Make all posible migration functions static, Juan Quintela, 2011/10/11
- [Qemu-devel] [PATCH 21/36] migration: move migrate_new to do_migrate, Juan Quintela, 2011/10/11
- [Qemu-devel] [PATCH 19/36] migration: Refactor MigrationState creation, Juan Quintela, 2011/10/11
- [Qemu-devel] [PATCH 22/36] migration: Introduce MIG_STATE_SETUP, Juan Quintela, 2011/10/11
- [Qemu-devel] [PATCH 23/36] migration: Refactor and simplify error checking in migrate_fd_put_ready, Juan Quintela, 2011/10/11
- [Qemu-devel] [PATCH 24/36] migration: Introduce migrate_fd_completed() for consistency,
Juan Quintela <=
- [Qemu-devel] [PATCH 28/36] migration: Move exported functions to the end of the file, Juan Quintela, 2011/10/11
- [Qemu-devel] [PATCH 30/36] migration: Use bandwidth_limit directly, Juan Quintela, 2011/10/11
- [Qemu-devel] [PATCH 29/36] migration: create accessor for current_migration, Juan Quintela, 2011/10/11
- [Qemu-devel] [PATCH 31/36] migration: Pass MigrationState in migration notifiers, Juan Quintela, 2011/10/11
- [Qemu-devel] [PATCH 34/36] migration: Don't use callback on file defining it, Juan Quintela, 2011/10/11
- [Qemu-devel] [PATCH 35/36] migration: propagate error correctly, Juan Quintela, 2011/10/11
- [Qemu-devel] [PATCH 36/36] migration: make migration-{tcp, unix} consistent, Juan Quintela, 2011/10/11
- [Qemu-devel] [PATCH 17/36] migration: Fold MigrationState into FdMigrationState, Juan Quintela, 2011/10/11
- [Qemu-devel] [PATCH 18/36] migration: Rename FdMigrationState MigrationState, Juan Quintela, 2011/10/11
- [Qemu-devel] [PATCH 10/36] migration: set error if select return one error, Juan Quintela, 2011/10/11