X-Git-Url: http://vcs.maemo.org/git/?a=blobdiff_plain;f=migration-exec.c;h=f0869a1146e6f42d357f1a505fe854507d5eeb6e;hb=769ce76d0e220e1ecde16154e76d43cf7099e7c6;hp=caeed4bbc0eee01493560206db136cd6b53a1575;hpb=8ad9fa5d8be7fd04e723020088eca664971eb363;p=qemu diff --git a/migration-exec.c b/migration-exec.c index caeed4b..f0869a1 100644 --- a/migration-exec.c +++ b/migration-exec.c @@ -18,7 +18,6 @@ #include "migration.h" #include "qemu-char.h" #include "sysemu.h" -#include "console.h" #include "buffered_file.h" #include "block.h" @@ -55,16 +54,12 @@ static int exec_close(FdMigrationState *s) MigrationState *exec_start_outgoing_migration(const char *command, int64_t bandwidth_limit, - int async) + int detach) { FdMigrationState *s; FILE *f; s = qemu_mallocz(sizeof(*s)); - if (s == NULL) { - dprintf("Unable to allocate FdMigrationState\n"); - goto err; - } f = popen(command, "w"); if (f == NULL) { @@ -93,14 +88,11 @@ MigrationState *exec_start_outgoing_migration(const char *command, s->mig_state.release = migrate_fd_release; s->state = MIG_STATE_ACTIVE; - s->detach = !async; + s->mon_resume = NULL; s->bandwidth_limit = bandwidth_limit; - if (s->detach == 1) { - dprintf("detaching from monitor\n"); - monitor_suspend(); - s->detach = 2; - } + if (!detach) + migrate_fd_monitor_suspend(s); migrate_fd_connect(s); return &s->mig_state; @@ -109,7 +101,6 @@ err_after_open: pclose(f); err_after_alloc: qemu_free(s); -err: return NULL; }