diff options
author | Juan Quintela <quintela@redhat.com> | 2010-05-11 22:27:45 +0200 |
---|---|---|
committer | Juan Quintela <quintela@redhat.com> | 2011-10-20 13:23:53 +0200 |
commit | 07af4452919fddc6dca6462828b457aad62f6387 (patch) | |
tree | b1a6775ce2293625ccfd525349614fee564b8c47 /migration-tcp.c | |
parent | 8b6b99b3561b8da3b15da1871e1bb3d4ac7770ca (diff) | |
download | qemu-07af4452919fddc6dca6462828b457aad62f6387.zip qemu-07af4452919fddc6dca6462828b457aad62f6387.tar.gz qemu-07af4452919fddc6dca6462828b457aad62f6387.tar.bz2 |
migration: move migrate_new to do_migrate
Once there, remove all parameters that don't need to be passed to
*start_outgoing_migration() functions
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.c | 22 |
1 files changed, 7 insertions, 15 deletions
diff --git a/migration-tcp.c b/migration-tcp.c index 999d4c9..f6b2288 100644 --- a/migration-tcp.c +++ b/migration-tcp.c @@ -75,30 +75,22 @@ static void tcp_wait_for_connect(void *opaque) } } -MigrationState *tcp_start_outgoing_migration(Monitor *mon, - const char *host_port, - int64_t bandwidth_limit, - int detach, - int blk, - int inc) +int tcp_start_outgoing_migration(MigrationState *s, const char *host_port) { struct sockaddr_in addr; - MigrationState *s; int ret; - if (parse_host_port(&addr, host_port) < 0) - return NULL; - - s = migrate_new(mon, bandwidth_limit, detach, blk, inc); - + ret = parse_host_port(&addr, host_port); + if (ret < 0) { + return ret; + } s->get_error = socket_errno; s->write = socket_write; s->close = tcp_close; s->fd = qemu_socket(PF_INET, SOCK_STREAM, 0); if (s->fd == -1) { - g_free(s); - return NULL; + return -1; } socket_set_nonblock(s->fd); @@ -118,7 +110,7 @@ MigrationState *tcp_start_outgoing_migration(Monitor *mon, } else if (ret >= 0) migrate_fd_connect(s); - return s; + return 0; } static void tcp_accept_incoming_migration(void *opaque) |