diff options
author | Jan Kiszka <jan.kiszka@siemens.com> | 2009-11-30 18:21:21 +0100 |
---|---|---|
committer | Anthony Liguori <aliguori@us.ibm.com> | 2009-12-03 10:48:53 -0600 |
commit | f327aa0c608b4bae3c93f0fbd0afcfdd9c9635bc (patch) | |
tree | c8a24861d58587a3b2107cb22fda348b2d746e00 /migration.c | |
parent | 82801d8f4f3fa7413647495d9823fb3144c31ddc (diff) |
live migration: Propagate output monitor to callback handler
In order to allow proper progress reporting to the monitor that
initiated the migration, forward the monitor reference through the
migration layer down to SaveLiveStateHandler.
Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Diffstat (limited to 'migration.c')
-rw-r--r-- | migration.c | 30 |
1 files changed, 16 insertions, 14 deletions
diff --git a/migration.c b/migration.c index f8a15fb485..f4d30222da 100644 --- a/migration.c +++ b/migration.c @@ -66,16 +66,16 @@ void do_migrate(Monitor *mon, const QDict *qdict, QObject **ret_data) } if (strstart(uri, "tcp:", &p)) - s = tcp_start_outgoing_migration(p, max_throttle, detach, + s = tcp_start_outgoing_migration(mon, p, max_throttle, detach, (int)qdict_get_int(qdict, "blk"), (int)qdict_get_int(qdict, "inc")); #if !defined(WIN32) else if (strstart(uri, "exec:", &p)) - s = exec_start_outgoing_migration(p, max_throttle, detach, + s = exec_start_outgoing_migration(mon, p, max_throttle, detach, (int)qdict_get_int(qdict, "blk"), (int)qdict_get_int(qdict, "inc")); else if (strstart(uri, "unix:", &p)) - s = unix_start_outgoing_migration(p, max_throttle, detach, + s = unix_start_outgoing_migration(mon, p, max_throttle, detach, (int)qdict_get_int(qdict, "blk"), (int)qdict_get_int(qdict, "inc")); else if (strstart(uri, "fd:", &p)) @@ -190,14 +190,15 @@ void do_info_migrate(Monitor *mon) /* shared migration helpers */ -void migrate_fd_monitor_suspend(FdMigrationState *s) +void migrate_fd_monitor_suspend(FdMigrationState *s, Monitor *mon) { - s->mon_resume = cur_mon; - if (monitor_suspend(cur_mon) == 0) + s->mon = mon; + if (monitor_suspend(mon) == 0) { dprintf("suspending monitor\n"); - else - monitor_printf(cur_mon, "terminal does not allow synchronous " + } else { + monitor_printf(mon, "terminal does not allow synchronous " "migration, continuing detached\n"); + } } void migrate_fd_error(FdMigrationState *s) @@ -221,8 +222,9 @@ void migrate_fd_cleanup(FdMigrationState *s) close(s->fd); /* Don't resume monitor until we've flushed all of the buffers */ - if (s->mon_resume) - monitor_resume(s->mon_resume); + if (s->mon) { + monitor_resume(s->mon); + } s->fd = -1; } @@ -265,7 +267,7 @@ void migrate_fd_connect(FdMigrationState *s) migrate_fd_close); dprintf("beginning savevm\n"); - ret = qemu_savevm_state_begin(s->file, s->mig_state.blk, + ret = qemu_savevm_state_begin(s->mon, s->file, s->mig_state.blk, s->mig_state.shared); if (ret < 0) { dprintf("failed, %d\n", ret); @@ -286,7 +288,7 @@ void migrate_fd_put_ready(void *opaque) } dprintf("iterate\n"); - if (qemu_savevm_state_iterate(s->file) == 1) { + if (qemu_savevm_state_iterate(s->mon, s->file) == 1) { int state; int old_vm_running = vm_running; @@ -295,7 +297,7 @@ void migrate_fd_put_ready(void *opaque) qemu_aio_flush(); bdrv_flush_all(); - if ((qemu_savevm_state_complete(s->file)) < 0) { + if ((qemu_savevm_state_complete(s->mon, s->file)) < 0) { if (old_vm_running) { vm_start(); } @@ -324,7 +326,7 @@ void migrate_fd_cancel(MigrationState *mig_state) dprintf("cancelling migration\n"); s->state = MIG_STATE_CANCELLED; - qemu_savevm_state_cancel(s->file); + qemu_savevm_state_cancel(s->mon, s->file); migrate_fd_cleanup(s); } |