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-unix.c | 15 +-------------- 1 file changed, 1 insertion(+), 14 deletions(-) (limited to 'migration-unix.c') diff --git a/migration-unix.c b/migration-unix.c index 3b9017be49..bee71d966c 100644 --- a/migration-unix.c +++ b/migration-unix.c @@ -88,21 +88,12 @@ MigrationState *unix_start_outgoing_migration(Monitor *mon, addr.sun_family = AF_UNIX; snprintf(addr.sun_path, sizeof(addr.sun_path), "%s", path); - s = g_malloc0(sizeof(*s)); + s = migrate_new(mon, bandwidth_limit, detach, blk, inc); s->get_error = unix_errno; s->write = unix_write; s->close = unix_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_UNIX, SOCK_STREAM, 0); if (s->fd < 0) { DPRINTF("Unable to open socket"); @@ -125,10 +116,6 @@ MigrationState *unix_start_outgoing_migration(Monitor *mon, goto err_after_open; } - if (!detach) { - migrate_fd_monitor_suspend(s, mon); - } - if (ret >= 0) migrate_fd_connect(s); -- cgit v1.2.1