vhost: drop virtqueues only with built-in virtio driver
authorStefan Hajnoczi <stefanha@redhat.com>
Wed, 31 Jan 2018 17:46:51 +0000 (17:46 +0000)
committerFerruh Yigit <ferruh.yigit@intel.com>
Mon, 5 Feb 2018 14:11:19 +0000 (15:11 +0100)
commit33adfbc805651f455dbf19f1e4b4b0878717a5e5
tree354609d7e015393e477d8dbe815f515473629bad
parent1c717af4c699e60081feb1d645f86189551f9a9c
vhost: drop virtqueues only with built-in virtio driver

Commit e29109323595beb3884da58126ebb3b878cb66f5 ("vhost: destroy unused
virtqueues when multiqueue not negotiated") broke vhost-scsi by removing
virtqueues when the virtio-net-specific VIRTIO_NET_F_MQ feature bit is
missing.

The vhost_user.c code shouldn't assume all devices are vhost net device
backends.  Use the new VIRTIO_DEV_BUILTIN_VIRTIO_NET flag to check
whether virtio_net.c is being used.

This fixes examples/vhost_scsi.

Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>
Acked-by: Yuanhan Liu <yliu@fridaylinux.org>
lib/librte_vhost/vhost_user.c