[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH 11/23] migration: Our release callback was just free
From: |
Juan Quintela |
Subject: |
[Qemu-devel] [PATCH 11/23] migration: Our release callback was just free |
Date: |
Fri, 23 Sep 2011 14:57:00 +0200 |
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 40fda7d..48c05b9 100644
--- a/migration.c
+++ b/migration.c
@@ -124,10 +124,7 @@ int do_migrate(Monitor *mon, const QDict *qdict, QObject
**ret_data)
goto free_migrate_state;
}
- if (current_migration) {
- current_migration->release(current_migration);
- }
-
+ g_free(current_migration);
current_migration = s;
notifier_list_notify(&migration_state_notifiers, NULL);
return 0;
@@ -417,19 +414,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, NULL);
- migrate_fd_cleanup(s);
- }
- g_free(s);
-}
-
static void migrate_fd_wait_for_unfreeze(void *opaque)
{
MigrationState *s = opaque;
@@ -513,7 +497,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 8792655..9ea1ad6 100644
--- a/migration.h
+++ b/migration.h
@@ -40,7 +40,6 @@ struct MigrationState
int (*write)(MigrationState *s, const void *buff, size_t size);
void (*cancel)(MigrationState *s);
int (*get_status)(MigrationState *s);
- void (*release)(MigrationState *s);
void *opaque;
int blk;
int shared;
--
1.7.6.2
- [Qemu-devel] [PATCH 06/23] migration: Make all posible migration functions static, (continued)
- [Qemu-devel] [PATCH 06/23] migration: Make all posible migration functions static, Juan Quintela, 2011/09/23
- [Qemu-devel] [PATCH 05/23] migration: Refactor MigrationState creation, Juan Quintela, 2011/09/23
- [Qemu-devel] [PATCH 10/23] migration: Introduce migrate_fd_completed() for consistency, Juan Quintela, 2011/09/23
- [Qemu-devel] [PATCH 12/23] migration: Remove get_status() accessor, Juan Quintela, 2011/09/23
- [Qemu-devel] [PATCH 15/23] migration: use global variable directly, Juan Quintela, 2011/09/23
- [Qemu-devel] [PATCH 17/23] migration: make sure we always have a migration state, Juan Quintela, 2011/09/23
- [Qemu-devel] [PATCH 13/23] migration: Remove migration cancel() callback, Juan Quintela, 2011/09/23
- [Qemu-devel] [PATCH 19/23] migration: Export a function that tells if the migration has finished correctly, Juan Quintela, 2011/09/23
- [Qemu-devel] [PATCH 18/23] migration: Use bandwidth_limit directly, Juan Quintela, 2011/09/23
- [Qemu-devel] [PATCH 14/23] migration: Move exported functions to the end of the file, Juan Quintela, 2011/09/23
- [Qemu-devel] [PATCH 11/23] migration: Our release callback was just free,
Juan Quintela <=
- [Qemu-devel] [PATCH 16/23] migration: another case of global variable assigned to local one, Juan Quintela, 2011/09/23
- [Qemu-devel] [PATCH 22/23] migration: propagate error correctly, Juan Quintela, 2011/09/23
- [Qemu-devel] [PATCH 21/23] migration: Don't use callback on file defining it, Juan Quintela, 2011/09/23
- [Qemu-devel] [PATCH 23/23] migration: make migration-{tcp, unix} consistent, Juan Quintela, 2011/09/23
- [Qemu-devel] [PATCH 20/23] migration: Make state definitions local, Juan Quintela, 2011/09/23