From 0edda1c42aa49dd3207f3c76bf25fd53ac16345d Mon Sep 17 00:00:00 2001 From: Juan Quintela Date: Tue, 11 May 2010 16:28:39 +0200 Subject: migration: Refactor MigrationState creation Signed-off-by: Juan Quintela Reviewed-by: Anthony Liguori --- migration-tcp.c | 15 +-------------- 1 file changed, 1 insertion(+), 14 deletions(-) (limited to 'migration-tcp.c') diff --git a/migration-tcp.c b/migration-tcp.c index d6feb237e..999d4c9aa 100644 --- a/migration-tcp.c +++ b/migration-tcp.c @@ -89,21 +89,12 @@ MigrationState *tcp_start_outgoing_migration(Monitor *mon, if (parse_host_port(&addr, host_port) < 0) return NULL; - s = g_malloc0(sizeof(*s)); + s = migrate_new(mon, bandwidth_limit, detach, blk, inc); s->get_error = socket_errno; s->write = socket_write; s->close = tcp_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_INET, SOCK_STREAM, 0); if (s->fd == -1) { g_free(s); @@ -112,10 +103,6 @@ MigrationState *tcp_start_outgoing_migration(Monitor *mon, socket_set_nonblock(s->fd); - if (!detach) { - migrate_fd_monitor_suspend(s, mon); - } - do { ret = connect(s->fd, (struct sockaddr *)&addr, sizeof(addr)); if (ret == -1) -- cgit v1.2.3