mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-03 07:43:54 -06:00
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>
This commit is contained in:
parent
8b6b99b356
commit
07af445291
6 changed files with 46 additions and 100 deletions
|
@ -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)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue