aboutsummaryrefslogtreecommitdiff
path: root/migration-fd.c
diff options
context:
space:
mode:
authorJuan Quintela <quintela@redhat.com>2010-05-11 16:28:39 +0200
committerJuan Quintela <quintela@redhat.com>2011-10-20 13:23:53 +0200
commit0edda1c42aa49dd3207f3c76bf25fd53ac16345d (patch)
tree17cfe4f206517d2fc9ded42b4b8c11cd2d28b16f /migration-fd.c
parent22f00a4445fac68b10d1cb669836eeb8d32af56d (diff)
migration: Refactor MigrationState creation
Signed-off-by: Juan Quintela <quintela@redhat.com> Reviewed-by: Anthony Liguori <aliguori@us.ibm.com>
Diffstat (limited to 'migration-fd.c')
-rw-r--r--migration-fd.c16
1 files changed, 1 insertions, 15 deletions
diff --git a/migration-fd.c b/migration-fd.c
index e78fd4e9e4..9d3ca420e0 100644
--- a/migration-fd.c
+++ b/migration-fd.c
@@ -59,7 +59,7 @@ MigrationState *fd_start_outgoing_migration(Monitor *mon,
{
MigrationState *s;
- s = g_malloc0(sizeof(*s));
+ s = migrate_new(mon, bandwidth_limit, detach, blk, inc);
s->fd = monitor_get_fd(mon, fdname);
if (s->fd == -1) {
@@ -75,20 +75,6 @@ MigrationState *fd_start_outgoing_migration(Monitor *mon,
s->get_error = fd_errno;
s->write = fd_write;
s->close = fd_close;
- s->cancel = migrate_fd_cancel;
- s->get_status = migrate_fd_get_status;
- s->release = migrate_fd_release;
-
- s->blk = blk;
- s->shared = inc;
-
- s->state = MIG_STATE_ACTIVE;
- s->mon = NULL;
- s->bandwidth_limit = bandwidth_limit;
-
- if (!detach) {
- migrate_fd_monitor_suspend(s, mon);
- }
migrate_fd_connect(s);
return s;