diff options
author | zhanghailiang <zhang.zhanghailiang@huawei.com> | 2017-01-17 20:57:43 +0800 |
---|---|---|
committer | Dr. David Alan Gilbert <dgilbert@redhat.com> | 2017-02-13 17:27:13 +0000 |
commit | c937b9a6db2d564b96aae35a6757bb4144ea5184 (patch) | |
tree | 1cf95ee7425b082b1c20778b45c34f36ed06649f /include/migration/migration.h | |
parent | 479125d53eb8509d69a0548f131028a65fcbd65a (diff) | |
download | qemu-c937b9a6db2d564b96aae35a6757bb4144ea5184.zip |
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 <zhang.zhanghailiang@huawei.com>
Signed-off-by: Li Zhijian <lizhijian@cn.fujitsu.com>
Reviewed-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
Cc: Dr. David Alan Gilbert <dgilbert@redhat.com>
Message-Id: <1484657864-21708-3-git-send-email-zhang.zhanghailiang@huawei.com>
Signed-off-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
Diffstat (limited to 'include/migration/migration.h')
-rw-r--r-- | include/migration/migration.h | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/include/migration/migration.h b/include/migration/migration.h index cb83f1688e..1735d66512 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; |