vhost-user: only set slave channel for first vq
When multiqueue is enabled, a vhost_dev is created for each queue
pair. However, only one slave channel is needed.
Fixes: 4bbeeba023
(vhost-user: add slave-req-fd support)
Cc: marcandre.lureau@redhat.com
Signed-off-by: Adrian Moreno <amorenoz@redhat.com>
Message-Id: <20200121214553.28459-1-amorenoz@redhat.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
This commit is contained in:
parent
fd9b0830b0
commit
67b3965e89
|
@ -1458,9 +1458,11 @@ static int vhost_user_backend_init(struct vhost_dev *dev, void *opaque)
|
||||||
"VHOST_USER_PROTOCOL_F_LOG_SHMFD feature.");
|
"VHOST_USER_PROTOCOL_F_LOG_SHMFD feature.");
|
||||||
}
|
}
|
||||||
|
|
||||||
err = vhost_setup_slave_channel(dev);
|
if (dev->vq_index == 0) {
|
||||||
if (err < 0) {
|
err = vhost_setup_slave_channel(dev);
|
||||||
return err;
|
if (err < 0) {
|
||||||
|
return err;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
u->postcopy_notifier.notify = vhost_user_postcopy_notifier;
|
u->postcopy_notifier.notify = vhost_user_postcopy_notifier;
|
||||||
|
|
Loading…
Reference in New Issue