vhost-user: add ability to know vhost-user backend disconnection
commita6553598be42e3be899acdb153fd615cd6c3eab8
authorTetsuya Mukawa <mukawa@igel.co.jp>
Mon, 6 Jun 2016 16:44:59 +0000 (6 18:44 +0200)
committerMichael S. Tsirkin <mst@redhat.com>
Fri, 17 Jun 2016 00:28:02 +0000 (17 03:28 +0300)
tree664992a1546c1310032f77b0d09a79ef7c630e29
parent4a94b3aa6d97dfa67a20c7a0315c9773352f0e8e
vhost-user: add ability to know vhost-user backend disconnection

Current QEMU cannot detect vhost-user backend disconnection. The
patch adds ability to know it.
To know disconnection, add watcher to detect G_IO_HUP event. When
G_IO_HUP event is detected, the disconnected socket will be read
to cause a CHR_EVENT_CLOSED.

Signed-off-by: Tetsuya Mukawa <mukawa@igel.co.jp>
Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Tested-by: Yuanhan Liu <yuanhan.liu@linux.intel.com>
Reviewed-by: Yuanhan Liu <yuanhan.liu@linux.intel.com>
Reviewed-by: Victor Kaplansky <victork@redhat.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
net/vhost-user.c