From c937b9a6db2d564b96aae35a6757bb4144ea5184 Mon Sep 17 00:00:00 2001 From: zhanghailiang Date: Tue, 17 Jan 2017 20:57:43 +0800 Subject: COLO: Shutdown related socket fd while do failover If the net connection between primary host and secondary host breaks while COLO/COLO incoming threads are doing read() or write(). It will block until connection is timeout, and the failover process will be blocked because of it. So it is necessary to shutdown all the socket fds used by COLO to avoid this situation. Besides, we should close the corresponding file descriptors after failvoer BH shutdown them, Or there will be an error. Signed-off-by: zhanghailiang Signed-off-by: Li Zhijian Reviewed-by: Dr. David Alan Gilbert Cc: Dr. David Alan Gilbert Message-Id: <1484657864-21708-3-git-send-email-zhang.zhanghailiang@huawei.com> Signed-off-by: Dr. David Alan Gilbert --- include/migration/migration.h | 3 +++ 1 file changed, 3 insertions(+) (limited to 'include/migration') diff --git a/include/migration/migration.h b/include/migration/migration.h index cb83f16..1735d66 100644 --- a/include/migration/migration.h +++ b/include/migration/migration.h @@ -116,6 +116,7 @@ struct MigrationIncomingState { QemuThread colo_incoming_thread; /* The coroutine we should enter (back) after failover */ Coroutine *migration_incoming_co; + QemuSemaphore colo_incoming_sem; /* See savevm.c */ LoadStateEntry_Head loadvm_handlers; @@ -187,6 +188,8 @@ struct MigrationState QSIMPLEQ_HEAD(src_page_requests, MigrationSrcPageRequest) src_page_requests; /* The RAMBlock used in the last src_page_request */ RAMBlock *last_req_rb; + /* The semaphore is used to notify COLO thread that failover is finished */ + QemuSemaphore colo_exit_sem; /* The semaphore is used to notify COLO thread to do checkpoint */ QemuSemaphore colo_checkpoint_sem; -- cgit v1.1