Restore the original code, where VHOST_SET_OWNER is applied to
all vhostfds of the device.
Fixes:
06856cabb89b ("net/virtio: add virtio-user ops to set owner")
Cc: stable@dpdk.org
Signed-off-by: Thierry Herbelot <thierry.herbelot@6wind.com>
Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>
static int
vhost_kernel_set_owner(struct virtio_user_dev *dev)
{
+ int ret;
+ uint32_t i;
struct vhost_kernel_data *data = dev->backend_data;
- return vhost_kernel_ioctl(data->vhostfds[0], VHOST_SET_OWNER, NULL);
+ for (i = 0; i < dev->max_queue_pairs; ++i) {
+ if (data->vhostfds[i] < 0)
+ continue;
+
+ ret = vhost_kernel_ioctl(data->vhostfds[i], VHOST_SET_OWNER, NULL);
+ if (ret < 0)
+ return ret;
+ }
+
+ return 0;
}
static int