Patchwork [01/28] migration: Make *start_outgoing_migration return FdMigrationState

login
register
mail settings
Submitter Juan Quintela
Date Feb. 23, 2011, 9:47 p.m.
Message ID <674490c0cd8c19f1b147fe283bfe753ebb953018.1298492768.git.quintela@redhat.com>
Download mbox | patch
Permalink /patch/84278/
State New
Headers show

Comments

Juan Quintela - Feb. 23, 2011, 9:47 p.m.
Signed-off-by: Juan Quintela <quintela@redhat.com>
---
 migration-exec.c |    4 ++--
 migration-fd.c   |    4 ++--
 migration-tcp.c  |    4 ++--
 migration-unix.c |    4 ++--
 migration.c      |    4 ++--
 migration.h      |    8 ++++----
 6 files changed, 14 insertions(+), 14 deletions(-)

Patch

diff --git a/migration-exec.c b/migration-exec.c
index 14718dd..b49a475 100644
--- a/migration-exec.c
+++ b/migration-exec.c
@@ -62,7 +62,7 @@  static int exec_close(FdMigrationState *s)
     return ret;
 }

-MigrationState *exec_start_outgoing_migration(Monitor *mon,
+FdMigrationState *exec_start_outgoing_migration(Monitor *mon,
                                               const char *command,
 					      int64_t bandwidth_limit,
 					      int detach,
@@ -109,7 +109,7 @@  MigrationState *exec_start_outgoing_migration(Monitor *mon,
     }

     migrate_fd_connect(s);
-    return &s->mig_state;
+    return s;

 err_after_open:
     pclose(f);
diff --git a/migration-fd.c b/migration-fd.c
index 6d14505..bd5e8a9 100644
--- a/migration-fd.c
+++ b/migration-fd.c
@@ -51,7 +51,7 @@  static int fd_close(FdMigrationState *s)
     return 0;
 }

-MigrationState *fd_start_outgoing_migration(Monitor *mon,
+FdMigrationState *fd_start_outgoing_migration(Monitor *mon,
 					    const char *fdname,
 					    int64_t bandwidth_limit,
 					    int detach,
@@ -92,7 +92,7 @@  MigrationState *fd_start_outgoing_migration(Monitor *mon,
     }

     migrate_fd_connect(s);
-    return &s->mig_state;
+    return s;

 err_after_open:
     close(s->fd);
diff --git a/migration-tcp.c b/migration-tcp.c
index b55f419..355bc37 100644
--- a/migration-tcp.c
+++ b/migration-tcp.c
@@ -76,7 +76,7 @@  static void tcp_wait_for_connect(void *opaque)
     }
 }

-MigrationState *tcp_start_outgoing_migration(Monitor *mon,
+FdMigrationState *tcp_start_outgoing_migration(Monitor *mon,
                                              const char *host_port,
                                              int64_t bandwidth_limit,
                                              int detach,
@@ -132,7 +132,7 @@  MigrationState *tcp_start_outgoing_migration(Monitor *mon,
     } else if (ret >= 0)
         migrate_fd_connect(s);

-    return &s->mig_state;
+    return s;
 }

 static void tcp_accept_incoming_migration(void *opaque)
diff --git a/migration-unix.c b/migration-unix.c
index 57232c0..b9b0dbf 100644
--- a/migration-unix.c
+++ b/migration-unix.c
@@ -75,7 +75,7 @@  static void unix_wait_for_connect(void *opaque)
     }
 }

-MigrationState *unix_start_outgoing_migration(Monitor *mon,
+FdMigrationState *unix_start_outgoing_migration(Monitor *mon,
                                               const char *path,
 					      int64_t bandwidth_limit,
 					      int detach,
@@ -133,7 +133,7 @@  MigrationState *unix_start_outgoing_migration(Monitor *mon,
     if (ret >= 0)
         migrate_fd_connect(s);

-    return &s->mig_state;
+    return s;

 err_after_open:
     close(s->fd);
diff --git a/migration.c b/migration.c
index af3a1f2..f9aaadc 100644
--- a/migration.c
+++ b/migration.c
@@ -78,7 +78,7 @@  void process_incoming_migration(QEMUFile *f)

 int do_migrate(Monitor *mon, const QDict *qdict, QObject **ret_data)
 {
-    MigrationState *s = NULL;
+    FdMigrationState *s = NULL;
     const char *p;
     int detach = qdict_get_try_bool(qdict, "detach", 0);
     int blk = qdict_get_try_bool(qdict, "blk", 0);
@@ -123,7 +123,7 @@  int do_migrate(Monitor *mon, const QDict *qdict, QObject **ret_data)
         current_migration->release(current_migration);
     }

-    current_migration = s;
+    current_migration = &s->mig_state;
     notifier_list_notify(&migration_state_notifiers);
     return 0;
 }
diff --git a/migration.h b/migration.h
index 2170792..db0e45a 100644
--- a/migration.h
+++ b/migration.h
@@ -72,7 +72,7 @@  void do_info_migrate(Monitor *mon, QObject **ret_data);

 int exec_start_incoming_migration(const char *host_port);

-MigrationState *exec_start_outgoing_migration(Monitor *mon,
+FdMigrationState *exec_start_outgoing_migration(Monitor *mon,
                                               const char *host_port,
 					      int64_t bandwidth_limit,
 					      int detach,
@@ -81,7 +81,7 @@  MigrationState *exec_start_outgoing_migration(Monitor *mon,

 int tcp_start_incoming_migration(const char *host_port);

-MigrationState *tcp_start_outgoing_migration(Monitor *mon,
+FdMigrationState *tcp_start_outgoing_migration(Monitor *mon,
                                              const char *host_port,
 					     int64_t bandwidth_limit,
 					     int detach,
@@ -90,7 +90,7 @@  MigrationState *tcp_start_outgoing_migration(Monitor *mon,

 int unix_start_incoming_migration(const char *path);

-MigrationState *unix_start_outgoing_migration(Monitor *mon,
+FdMigrationState *unix_start_outgoing_migration(Monitor *mon,
                                               const char *path,
 					      int64_t bandwidth_limit,
 					      int detach,
@@ -99,7 +99,7 @@  MigrationState *unix_start_outgoing_migration(Monitor *mon,

 int fd_start_incoming_migration(const char *path);

-MigrationState *fd_start_outgoing_migration(Monitor *mon,
+FdMigrationState *fd_start_outgoing_migration(Monitor *mon,
 					    const char *fdname,
 					    int64_t bandwidth_limit,
 					    int detach,