mirror of
https://github.com/cloud-hypervisor/cloud-hypervisor.git
synced 2026-08-05 02:19:16 +00:00
virtio-devices: vhost_user: Set proper avail index to vhost-user backend
We should try to read the last avail index from the vring memory aera. This is necessary when handling vhost-user socket reconnection. Signed-off-by: Jiachen Zhang <zhangjiachen.jaycee@bytedance.com>
This commit is contained in:
committed by
Sebastien Boeuf
parent
b443900cc2
commit
058946772a
@@ -143,8 +143,13 @@ pub fn setup_vhost_user(
|
||||
|
||||
vu.set_vring_addr(queue_index, &config_data)
|
||||
.map_err(Error::VhostUserSetVringAddr)?;
|
||||
vu.set_vring_base(queue_index, 0u16)
|
||||
.map_err(Error::VhostUserSetVringBase)?;
|
||||
vu.set_vring_base(
|
||||
queue_index,
|
||||
queue
|
||||
.avail_index_from_memory(mem)
|
||||
.map_err(Error::GetAvailableIndex)?,
|
||||
)
|
||||
.map_err(Error::VhostUserSetVringBase)?;
|
||||
|
||||
if let Some(eventfd) = virtio_interrupt.notifier(&VirtioInterruptType::Queue, Some(&queue))
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user