COLO: Shutdown related socket fd while do failover
commitc937b9a6db2d564b96aae35a6757bb4144ea5184
authorzhanghailiang <zhang.zhanghailiang@huawei.com>
Tue, 17 Jan 2017 12:57:43 +0000 (17 20:57 +0800)
committerDr. David Alan Gilbert <dgilbert@redhat.com>
Mon, 13 Feb 2017 17:27:13 +0000 (13 17:27 +0000)
tree1cf95ee7425b082b1c20778b45c34f36ed06649f
parent479125d53eb8509d69a0548f131028a65fcbd65a
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>
include/migration/migration.h
migration/colo.c