mirror of
https://github.com/mii443/qemu.git
synced 2025-12-16 17:18:49 +00:00
libvhost-user: support resuming vq->last_avail_idx based on used_idx
This is the same workaround as commit523b018dde, which was lost with libvhost-user transition in commite10e798c85. Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com> Reviewed-by: Michael S. Tsirkin <mst@redhat.com> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
This commit is contained in:
committed by
Michael S. Tsirkin
parent
0b4a775188
commit
35480cbfcb
@@ -521,6 +521,19 @@ vu_set_vring_addr_exec(VuDev *dev, VhostUserMsg *vmsg)
|
||||
|
||||
vq->used_idx = vq->vring.used->idx;
|
||||
|
||||
if (vq->last_avail_idx != vq->used_idx) {
|
||||
bool resume = dev->iface->queue_is_processed_in_order &&
|
||||
dev->iface->queue_is_processed_in_order(dev, index);
|
||||
|
||||
DPRINT("Last avail index != used index: %u != %u%s\n",
|
||||
vq->last_avail_idx, vq->used_idx,
|
||||
resume ? ", resuming" : "");
|
||||
|
||||
if (resume) {
|
||||
vq->shadow_avail_idx = vq->last_avail_idx = vq->used_idx;
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user