net/virtio-user: fix link status
authorJianfeng Tan <jianfeng.tan@intel.com>
Fri, 14 Apr 2017 06:10:30 +0000 (06:10 +0000)
committerYuanhan Liu <yuanhan.liu@linux.intel.com>
Wed, 19 Apr 2017 08:49:06 +0000 (10:49 +0200)
commitcc4690e980f4759e53a9f3d89f48d285a2801eec
treecf95a1e7afc5ccde310397840570d226bede6a11
parentaa9f060617653bac99f41dedfd518b7034374139
net/virtio-user: fix link status

Previously, we miss to set intr_handle->fd which will be used as
target file for epoll to check LSC.

As a result, stdin (0) is used and intr thread keeps busy whenever
data comes from stdin.

To fix this, we use vhostfd as the target file for epoll to check
the link status change events. And we move intr_handle initialization
after vhost backend settup to make sure vhostfd is initialized.

Fixes: 35c4f8554833 ("net/virtio-user: support to report net status")

Signed-off-by: Jianfeng Tan <jianfeng.tan@intel.com>
Acked-by: Yuanhan Liu <yuanhan.liu@linux.intel.com>
drivers/net/virtio/virtio_user/virtio_user_dev.c