/* shared migration helpers */
+void migrate_fd_monitor_suspend(FdMigrationState *s)
+{
+ s->mon_resume = cur_mon;
+ if (monitor_suspend(cur_mon) == 0)
+ dprintf("suspending monitor\n");
+ else
+ monitor_printf(cur_mon, "terminal does not allow synchronous "
+ "migration, continuing detached\n");
+}
+
void migrate_fd_error(FdMigrationState *s)
{
dprintf("setting error state\n");
close(s->fd);
/* Don't resume monitor until we've flushed all of the buffers */
- if (s->detach == 2) {
- monitor_resume(cur_mon);
- s->detach = 0;
- }
+ if (s->mon_resume)
+ monitor_resume(s->mon_resume);
s->fd = -1;
}