net/virtio-user: fix feature setting with vhost-net backend

When the backend is vhost-net, virtio-user must work in client mode and
needs to request features from the backend in virtio_user_dev_init().
But currently, virtio-user is assigned to default features in this case.

This patch is to fix this inappropriate feature setting.

Fixes: bd8f50a45d ("net/virtio-user: support server mode")

Signed-off-by: Jiayu Hu <jiayu.hu@intel.com>
Tested-by: Lei Yao <lei.a.yao@intel.com>
Reviewed-by: Tiwei Bie <tiwei.bie@intel.com>
Reviewed-by: Zhiyong Yang <zhiyong.yang@intel.com>
This commit is contained in:
Jiayu Hu 2018-05-11 15:26:07 +08:00 committed by Ferruh Yigit
parent 08b7521c35
commit 6e1e590457

View File

@ -396,7 +396,7 @@ virtio_user_dev_init(struct virtio_user_dev *dev, char *path, int queues,
return -1;
}
if (dev->vhostfd >= 0) {
if (!dev->is_server) {
if (dev->ops->send_request(dev, VHOST_USER_SET_OWNER,
NULL) < 0) {
PMD_INIT_LOG(ERR, "set_owner fails: %s",