[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH 11/28] migration: Introduce migrate_fd_completed() f
From: |
Juan Quintela |
Subject: |
[Qemu-devel] [PATCH 11/28] migration: Introduce migrate_fd_completed() for consistenncy |
Date: |
Wed, 23 Feb 2011 22:47:20 +0100 |
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 | 18 ++++++++++++------
1 files changed, 12 insertions(+), 6 deletions(-)
diff --git a/migration.c b/migration.c
index ed6e626..9be6bb0 100644
--- a/migration.c
+++ b/migration.c
@@ -318,6 +318,17 @@ 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;
+ }
+ notifier_list_notify(&migration_state_notifiers);
+}
+
static void migrate_fd_put_notify(void *opaque)
{
MigrationState *s = opaque;
@@ -371,12 +382,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;
- notifier_list_notify(&migration_state_notifiers);
- }
+ migrate_fd_completed(s);
}
if (s->get_status(s) != MIG_STATE_COMPLETED) {
if (old_vm_running) {
--
1.7.4
- [Qemu-devel] Re: [PATCH 21/28] migration: Make state definitions local, (continued)
[Qemu-devel] [PATCH 05/28] migration: Refactor MigrationState creation, Juan Quintela, 2011/02/23
[Qemu-devel] [PATCH 23/28] migration: add error handling to migrate_fd_put_notify()., Juan Quintela, 2011/02/23
[Qemu-devel] [PATCH 22/28] savevm: avoid qemu_savevm_state_iteate() to return 1 when qemu file has error., Juan Quintela, 2011/02/23
[Qemu-devel] [PATCH 24/28] migration: Don't use callback on file defining it, Juan Quintela, 2011/02/23
[Qemu-devel] [PATCH 25/28] migration: propagate error correctly, Juan Quintela, 2011/02/23
[Qemu-devel] [PATCH 26/28] migration: qemu_savevm_iterate has three return values, Juan Quintela, 2011/02/23
[Qemu-devel] [PATCH 27/28] migration: If there is one error, it makes no sense to continue, Juan Quintela, 2011/02/23
[Qemu-devel] [PATCH 28/28] migration: make migration-{tcp, unix} consistent, Juan Quintela, 2011/02/23
[Qemu-devel] [PATCH 11/28] migration: Introduce migrate_fd_completed() for consistenncy,
Juan Quintela <=
[Qemu-devel] [PATCH 15/28] migration: Move exported functions to the end of the file, Juan Quintela, 2011/02/23