[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH 11/22] migration: Introduce migrate_fd_completed() f
From: |
Juan Quintela |
Subject: |
[Qemu-devel] [PATCH 11/22] migration: Introduce migrate_fd_completed() for consistenncy |
Date: |
Wed, 23 Feb 2011 01:44:25 +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 641df9f..ab98664 100644
--- a/migration.c
+++ b/migration.c
@@ -317,6 +317,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;
@@ -369,12 +380,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] [PATCH 08/22] migration: Check that migration is active before cancel it, (continued)
- [Qemu-devel] [PATCH 11/22] migration: Introduce migrate_fd_completed() for consistenncy,
Juan Quintela <=
- [Qemu-devel] [PATCH 12/22] migration: Use migrate_fd_error() in last place that set status to ERROR, Juan Quintela, 2011/02/22
- [Qemu-devel] [PATCH 13/22] migration: Our release callback was just free, Juan Quintela, 2011/02/22
- [Qemu-devel] [PATCH 15/22] migration: Remove migration cancel() callback, Juan Quintela, 2011/02/22
- [Qemu-devel] [PATCH 14/22] migration: Remove get_status() accessor, Juan Quintela, 2011/02/22
- [Qemu-devel] [PATCH 16/22] migration: Move exported functions to the end of the file, Juan Quintela, 2011/02/22
- [Qemu-devel] [PATCH 17/22] migration: use global variable directly, Juan Quintela, 2011/02/22