diff options
authorJianfeng Tan <>2018-02-12 03:20:27 +0000
committerThomas Monjalon <>2018-02-13 18:58:02 +0100
commitbce7e9050f9b5e92cead60e8ac7768812ce898f2 (patch)
parent601e65370a7e41c72e4081d101c706a1e09fcf76 (diff)
net/virtio-user: fix start with kernel vhost
After reset owner in below patch, we failed to set owner before sending further vhost messages. It is OK with vhost user implemented DPDK/VPP/Contrail, but it sees "Operation not permitted" error when used with vhost kernel. We fix this by setting owner every time the device is started. Fixes: 0d6a8752ac9d ("net/virtio-user: fix crash as features change") Cc: Signed-off-by: Jianfeng Tan <> Reviewed-by: Maxime Coquelin <>
1 files changed, 4 insertions, 0 deletions
diff --git a/drivers/net/virtio/virtio_user/virtio_user_dev.c b/drivers/net/virtio/virtio_user/virtio_user_dev.c
index 3b5f737..b5809ee 100644
--- a/drivers/net/virtio/virtio_user/virtio_user_dev.c
+++ b/drivers/net/virtio/virtio_user/virtio_user_dev.c
@@ -99,6 +99,9 @@ virtio_user_start_device(struct virtio_user_dev *dev)
uint64_t features;
int ret;
+ /* Do not check return as already done in init, or reset in stop */
+ dev->ops->send_request(dev, VHOST_USER_SET_OWNER, NULL);
/* Step 0: tell vhost to create queues */
if (virtio_user_queue_setup(dev, virtio_user_create_queue) < 0)
goto error;
@@ -332,6 +335,7 @@ virtio_user_dev_init(struct virtio_user_dev *dev, char *path, int queues,
PMD_INIT_LOG(ERR, "backend set up fails");
return -1;
if (dev->ops->send_request(dev, VHOST_USER_SET_OWNER, NULL) < 0) {
PMD_INIT_LOG(ERR, "set_owner fails: %s", strerror(errno));
return -1;