Migration with fd uses s->mon to pass the fd. But we only assign the
s->mon for !detached migration. Fix it. Once there add a comment
indicating that s->mon has two uses.
Bug reported by: Wen Congyang <wency@cn.fujitsu.com>
Signed-off-by: Juan Quintela <quintela@redhat.com>
CC: Wen Congyang <wency@cn.fujitsu.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
static void migrate_fd_monitor_suspend(MigrationState *s, Monitor *mon)
{
- s->mon = mon;
if (monitor_suspend(mon) == 0) {
DPRINTF("suspending monitor\n");
} else {
s->bandwidth_limit = bandwidth_limit;
s->blk = blk;
s->shared = inc;
- s->mon = NULL;
+
+ /* s->mon is used for two things:
+ - pass fd in fd migration
+ - suspend/resume monitor for not detached migration
+ */
+ s->mon = mon;
s->bandwidth_limit = bandwidth_limit;
s->state = MIG_STATE_SETUP;
return ret;
}
+ if (detach) {
+ s->mon = NULL;
+ }
+
notifier_list_notify(&migration_state_notifiers, s);
return 0;
}