Reorganize and fix monitor resume after migration
authorJan Kiszka <jan.kiszka@siemens.com>
Fri, 5 Aug 2011 07:11:26 +0000 (09:11 +0200)
committerAnthony Liguori <aliguori@us.ibm.com>
Fri, 5 Aug 2011 16:55:11 +0000 (11:55 -0500)
commit84ec65520bbcc249b50ba9ab3c2c29fcc4ea95b0
tree4a481693f7fe27df50c9299f8b331fed03c65ecd
parent2da8bb92fb128e686dc9e055defbc5652f7c001d
Reorganize and fix monitor resume after migration

If migration failed in migrate_fd_put_buffer, the monitor may have been
resumed not only in the error path of that function but also once again
in migrate_fd_put_ready which is called unconditionally by
migrate_fd_connect.

Fix this by establishing a cleaner policy: the monitor shall be resumed
when the migration file is closed, either via callback
(migrate_fd_close) or in migrate_fd_cleanup if no file is open (i.e. no
callback invoked).

Reported-By: Michael Tokarev <mjt@tls.msk.ru>
Tested-By: Michael Tokarev <mjt@tls.msk.ru>
Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
migration.c