diff options
author | Juan Quintela <quintela@redhat.com> | 2010-05-11 23:18:34 +0200 |
---|---|---|
committer | Juan Quintela <quintela@redhat.com> | 2011-10-20 13:23:53 +0200 |
commit | 92920cd782d3b36bea64d79f162567c873882c4e (patch) | |
tree | 7cab2c6c7191135cd74ecbec9ab92dddeda0b6d4 /migration.c | |
parent | 458cf28e6b01ff9b87a20d199d42b1c1c904cd29 (diff) |
migration: Our release callback was just free
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 <quintela@redhat.com>
Reviewed-by: Anthony Liguori <aliguori@us.ibm.com>
Diffstat (limited to 'migration.c')
-rw-r--r-- | migration.c | 19 |
1 files changed, 1 insertions, 18 deletions
diff --git a/migration.c b/migration.c index a7c7b41b61..400ffb7897 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); - } - + g_free(current_migration); current_migration = s; notifier_list_notify(&migration_state_notifiers, NULL); return 0; @@ -416,19 +413,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; @@ -511,7 +495,6 @@ static MigrationState *migrate_new(Monitor *mon, int64_t bandwidth_limit, 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; |