aboutsummaryrefslogtreecommitdiff
path: root/migration-tcp.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-tcp.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-tcp.c')
-rw-r--r--migration-tcp.c15
1 files changed, 1 insertions, 14 deletions
diff --git a/migration-tcp.c b/migration-tcp.c
index d6feb237ed..999d4c9aac 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)