summaryrefslogtreecommitdiff
path: root/migration-unix.c
diff options
context:
space:
mode:
authorJuan Quintela <quintela@redhat.com>2010-05-11 22:27:45 +0200
committerJuan Quintela <quintela@redhat.com>2011-10-20 13:23:53 +0200
commit07af4452919fddc6dca6462828b457aad62f6387 (patch)
treeb1a6775ce2293625ccfd525349614fee564b8c47 /migration-unix.c
parent8b6b99b3561b8da3b15da1871e1bb3d4ac7770ca (diff)
downloadqemu-07af4452919fddc6dca6462828b457aad62f6387.tar.gz
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-unix.c')
-rw-r--r--migration-unix.c20
1 files changed, 5 insertions, 15 deletions
diff --git a/migration-unix.c b/migration-unix.c
index bee71d966c..bd8d40fe78 100644
--- a/migration-unix.c
+++ b/migration-unix.c
@@ -74,22 +74,13 @@ static void unix_wait_for_connect(void *opaque)
}
}
-MigrationState *unix_start_outgoing_migration(Monitor *mon,
- const char *path,
- int64_t bandwidth_limit,
- int detach,
- int blk,
- int inc)
+int unix_start_outgoing_migration(MigrationState *s, const char *path)
{
- MigrationState *s;
struct sockaddr_un addr;
int ret;
addr.sun_family = AF_UNIX;
snprintf(addr.sun_path, sizeof(addr.sun_path), "%s", path);
-
- s = migrate_new(mon, bandwidth_limit, detach, blk, inc);
-
s->get_error = unix_errno;
s->write = unix_write;
s->close = unix_close;
@@ -97,7 +88,7 @@ MigrationState *unix_start_outgoing_migration(Monitor *mon,
s->fd = qemu_socket(PF_UNIX, SOCK_STREAM, 0);
if (s->fd < 0) {
DPRINTF("Unable to open socket");
- goto err_after_alloc;
+ goto err_after_socket;
}
socket_set_nonblock(s->fd);
@@ -119,14 +110,13 @@ MigrationState *unix_start_outgoing_migration(Monitor *mon,
if (ret >= 0)
migrate_fd_connect(s);
- return s;
+ return 0;
err_after_open:
close(s->fd);
-err_after_alloc:
- g_free(s);
- return NULL;
+err_after_socket:
+ return -1;
}
static void unix_accept_incoming_migration(void *opaque)