mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-01 14:53:54 -06: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:
parent
0b4a775188
commit
35480cbfcb
2 changed files with 20 additions and 0 deletions
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue