summaryrefslogtreecommitdiff
path: root/migration-exec.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-exec.c
parent22f00a4445fac68b10d1cb669836eeb8d32af56d (diff)
downloadqemu-0edda1c42aa49dd3207f3c76bf25fd53ac16345d.tar.gz
migration: Refactor MigrationState creation
Signed-off-by: Juan Quintela <quintela@redhat.com> Reviewed-by: Anthony Liguori <aliguori@us.ibm.com>
Diffstat (limited to 'migration-exec.c')
-rw-r--r--migration-exec.c16
1 files changed, 1 insertions, 15 deletions
diff --git a/migration-exec.c b/migration-exec.c
index 0ed5976699..d0119c67d8 100644
--- a/migration-exec.c
+++ b/migration-exec.c
@@ -71,7 +71,7 @@ MigrationState *exec_start_outgoing_migration(Monitor *mon,
MigrationState *s;
FILE *f;
- s = g_malloc0(sizeof(*s));
+ s = migrate_new(mon, bandwidth_limit, detach, blk, inc);
f = popen(command, "w");
if (f == NULL) {
@@ -92,20 +92,6 @@ MigrationState *exec_start_outgoing_migration(Monitor *mon,
s->close = exec_close;
s->get_error = file_errno;
s->write = file_write;
- 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;
-
- if (!detach) {
- migrate_fd_monitor_suspend(s, mon);
- }
migrate_fd_connect(s);
return s;