diff mbox

[27/36] migration: Remove migration cancel() callback

Message ID 7b79004bbfdeefc159ab822aed7a193b0ce7f207.1318326684.git.quintela@redhat.com
State New
Headers show

Commit Message

Juan Quintela Oct. 11, 2011, 10 a.m. UTC
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(-)
diff mbox

Patch

diff --git a/migration.c b/migration.c
index 0b7ffa7..33e89a2 100644
--- a/migration.c
+++ b/migration.c
@@ -132,12 +132,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;
 }
@@ -488,7 +488,6 @@  static MigrationState *migrate_new(Monitor *mon, int64_t bandwidth_limit,
 {
     MigrationState *s = g_malloc0(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 b634994..f059183 100644
--- a/migration.h
+++ b/migration.h
@@ -38,7 +38,6 @@  struct MigrationState
     int (*get_error)(MigrationState *s);
     int (*close)(MigrationState *s);
     int (*write)(MigrationState *s, const void *buff, size_t size);
-    void (*cancel)(MigrationState *s);
     void *opaque;
     int blk;
     int shared;