diff options
author | Juan Quintela <quintela@redhat.com> | 2011-11-09 21:29:01 +0100 |
---|---|---|
committer | Anthony Liguori <aliguori@us.ibm.com> | 2011-11-11 12:49:51 -0600 |
commit | 1299c63168e9f3d47b681b8c505d39f577ddd253 (patch) | |
tree | c82bfea45b9062f55d93c9fe645ad2da8fe54d04 /migration.c | |
parent | f2338fb48a3bca830aa1d694a117fe90751c3978 (diff) |
migration: fix detached migration with fd
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>
Diffstat (limited to 'migration.c')
-rw-r--r-- | migration.c | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/migration.c b/migration.c index 4b17566857..41c3c24e09 100644 --- a/migration.c +++ b/migration.c @@ -155,7 +155,6 @@ MigrationInfo *qmp_query_migrate(Error **errp) static void migrate_fd_monitor_suspend(MigrationState *s, Monitor *mon) { - s->mon = mon; if (monitor_suspend(mon) == 0) { DPRINTF("suspending monitor\n"); } else { @@ -383,7 +382,12 @@ static MigrationState *migrate_init(Monitor *mon, int detach, int blk, int inc) 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; @@ -435,6 +439,10 @@ int do_migrate(Monitor *mon, const QDict *qdict, QObject **ret_data) return ret; } + if (detach) { + s->mon = NULL; + } + notifier_list_notify(&migration_state_notifiers, s); return 0; } |