[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH 12/28] migration: Our release callback was just free
From: |
Juan Quintela |
Subject: |
[Qemu-devel] [PATCH 12/28] migration: Our release callback was just free |
Date: |
Wed, 23 Feb 2011 22:47:21 +0100 |
We called it from a single place, and always with state !=
MIG_STATE_ACTIVE. Just remove the whole callback. For users of the
notifier, notice that this is exactly the case where they don't care,
we are just freeing the state from previous failed migration (it can't
be a sucessful one, otherwise we would not be running on that machine
in the first place).
Signed-off-by: Juan Quintela <address@hidden>
---
migration.c | 19 +------------------
migration.h | 1 -
2 files changed, 1 insertions(+), 19 deletions(-)
diff --git a/migration.c b/migration.c
index 9be6bb0..936b8f1 100644
--- a/migration.c
+++ b/migration.c
@@ -123,10 +123,7 @@ int do_migrate(Monitor *mon, const QDict *qdict, QObject
**ret_data)
goto free_migrate_state;
}
- if (current_migration) {
- current_migration->release(current_migration);
- }
-
+ qemu_free(current_migration);
current_migration = s;
notifier_list_notify(&migration_state_notifiers);
return 0;
@@ -411,19 +408,6 @@ static void migrate_fd_cancel(MigrationState *s)
migrate_fd_cleanup(s);
}
-static void migrate_fd_release(MigrationState *s)
-{
-
- DPRINTF("releasing state\n");
-
- if (s->state == MIG_STATE_ACTIVE) {
- s->state = MIG_STATE_CANCELLED;
- notifier_list_notify(&migration_state_notifiers);
- migrate_fd_cleanup(s);
- }
- qemu_free(s);
-}
-
static void migrate_fd_wait_for_unfreeze(void *opaque)
{
MigrationState *s = opaque;
@@ -501,7 +485,6 @@ static MigrationState *migrate_create_state(Monitor *mon,
s->cancel = migrate_fd_cancel;
s->get_status = migrate_fd_get_status;
- s->release = migrate_fd_release;
s->blk = blk;
s->shared = inc;
s->mon = NULL;
diff --git a/migration.h b/migration.h
index 266c9f0..b90e344 100644
--- a/migration.h
+++ b/migration.h
@@ -40,7 +40,6 @@ struct MigrationState
int (*write)(MigrationState *s, const void *buffer, size_t size);
void (*cancel)(MigrationState *s);
int (*get_status)(MigrationState *s);
- void (*release)(MigrationState *s);
void *opaque;
int blk;
int shared;
--
1.7.4
- [Qemu-devel] [PATCH v2 00/28] Refactor and cleanup migration code, Juan Quintela, 2011/02/23
- [Qemu-devel] [PATCH 01/28] migration: Make *start_outgoing_migration return FdMigrationState, Juan Quintela, 2011/02/23
- [Qemu-devel] [PATCH 02/28] migration: Use FdMigrationState instead of MigrationState when possible, Juan Quintela, 2011/02/23
- [Qemu-devel] [PATCH 04/28] migration: Rename FdMigrationState MigrationState, Juan Quintela, 2011/02/23
- [Qemu-devel] [PATCH 10/28] migration: Refactor and simplify error checking in migrate_fd_put_ready, Juan Quintela, 2011/02/23
- [Qemu-devel] [PATCH 09/28] migration: Introduce MIG_STATE_NONE, Juan Quintela, 2011/02/23
- [Qemu-devel] [PATCH 12/28] migration: Our release callback was just free,
Juan Quintela <=
- [Qemu-devel] [PATCH 13/28] migration: Remove get_status() accessor, Juan Quintela, 2011/02/23
- [Qemu-devel] [PATCH 14/28] migration: Remove migration cancel() callback, Juan Quintela, 2011/02/23
- [Qemu-devel] [PATCH 08/28] migration: Check that migration is active before cancel it, Juan Quintela, 2011/02/23
- [Qemu-devel] [PATCH 06/28] migration: Make all posible migration functions static, Juan Quintela, 2011/02/23
- [Qemu-devel] [PATCH 03/28] migration: Fold MigrationState into FdMigrationState, Juan Quintela, 2011/02/23
- [Qemu-devel] [PATCH 16/28] migration: use global variable directly, Juan Quintela, 2011/02/23