Patchwork [15/22] migration: Remove migration cancel() callback

login
register
mail settings
Submitter Juan Quintela
Date Feb. 23, 2011, 12:44 a.m.
Message ID <54e6039bde828eed6f3cd10e60333aaa90d16033.1298421307.git.quintela@redhat.com>
Download mbox | patch
Permalink /patch/84032/
State New
Headers show

Comments

Juan Quintela - Feb. 23, 2011, 12:44 a.m.
It is used only in one place

Signed-off-by: Juan Quintela <quintela@redhat.com>
---
 migration.c |    9 ++++-----
 migration.h |    1 -
 2 files changed, 4 insertions(+), 6 deletions(-)

Patch

diff --git a/migration.c b/migration.c
index 2b873fa..92bff01 100644
--- a/migration.c
+++ b/migration.c
@@ -131,12 +131,12 @@  free_migrate_state:
     return -1;
 }

+static void migrate_fd_cancel(MigrationState *s);
+
 int do_migrate_cancel(Monitor *mon, const QDict *qdict, QObject **ret_data)
 {
-    MigrationState *s = current_migration;
-
-    if (s && s->state == MIG_STATE_ACTIVE)
-        s->cancel(s);
+    if (current_migration)
+        migrate_fd_cancel(current_migration);

     return 0;
 }
@@ -471,7 +471,6 @@  static MigrationState *migrate_create_state(Monitor *mon, int64_t bandwidth_limi
 {
     MigrationState *s = qemu_mallocz(sizeof(*s));

-    s->cancel = migrate_fd_cancel;
     s->blk = blk;
     s->shared = inc;
     s->mon = NULL;
diff --git a/migration.h b/migration.h
index 58a6e06..6477b51 100644
--- a/migration.h
+++ b/migration.h
@@ -36,7 +36,6 @@  struct MigrationState
     int (*get_error)(MigrationState*);
     int (*close)(MigrationState*);
     int (*write)(MigrationState*, const void *, size_t);
-    void (*cancel)(MigrationState *s);
     void *opaque;
     int blk;
     int shared;