aboutsummaryrefslogtreecommitdiff
path: root/migration-unix.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-unix.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-unix.c')
-rw-r--r--migration-unix.c15
1 files changed, 1 insertions, 14 deletions
diff --git a/migration-unix.c b/migration-unix.c
index 3b9017be49..bee71d966c 100644
--- a/migration-unix.c
+++ b/migration-unix.c
@@ -88,21 +88,12 @@ MigrationState *unix_start_outgoing_migration(Monitor *mon,
addr.sun_family = AF_UNIX;
snprintf(addr.sun_path, sizeof(addr.sun_path), "%s", path);
- s = g_malloc0(sizeof(*s));
+ s = migrate_new(mon, bandwidth_limit, detach, blk, inc);
s->get_error = unix_errno;
s->write = unix_write;
s->close = unix_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;
s->fd = qemu_socket(PF_UNIX, SOCK_STREAM, 0);
if (s->fd < 0) {
DPRINTF("Unable to open socket");
@@ -125,10 +116,6 @@ MigrationState *unix_start_outgoing_migration(Monitor *mon,
goto err_after_open;
}
- if (!detach) {
- migrate_fd_monitor_suspend(s, mon);
- }
-
if (ret >= 0)
migrate_fd_connect(s);