[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-stable] [PATCH 04/25] virtio: decrement vq->inuse in virtqueue_dis
From: |
Michael Roth |
Subject: |
[Qemu-stable] [PATCH 04/25] virtio: decrement vq->inuse in virtqueue_discard() |
Date: |
Tue, 20 Sep 2016 12:05:20 -0500 |
From: Stefan Hajnoczi <address@hidden>
virtqueue_discard() moves vq->last_avail_idx back so the element can be
popped again. It's necessary to decrement vq->inuse to avoid "leaking"
the element count.
Cc: address@hidden
Signed-off-by: Stefan Hajnoczi <address@hidden>
Reviewed-by: Michael S. Tsirkin <address@hidden>
Reviewed-by: Cornelia Huck <address@hidden>
Reviewed-by: Michael S. Tsirkin <address@hidden>
Signed-off-by: Michael S. Tsirkin <address@hidden>
(cherry picked from commit 58a83c61496eeb0d31571a07a51bc1947e3379ac)
Signed-off-by: Michael Roth <address@hidden>
---
hw/virtio/virtio.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/hw/virtio/virtio.c b/hw/virtio/virtio.c
index 0333bb8..5fbaaaa 100644
--- a/hw/virtio/virtio.c
+++ b/hw/virtio/virtio.c
@@ -267,6 +267,7 @@ void virtqueue_discard(VirtQueue *vq, const
VirtQueueElement *elem,
unsigned int len)
{
vq->last_avail_idx--;
+ vq->inuse--;
virtqueue_unmap_sg(vq, elem, len);
}
--
1.9.1
- [Qemu-stable] [PATCH 02/25] ui: fix refresh of VNC server surface, (continued)
- [Qemu-stable] [PATCH 02/25] ui: fix refresh of VNC server surface, Michael Roth, 2016/09/20
- [Qemu-stable] [PATCH 25/25] virtio-scsi: Don't abort when media is ejected, Michael Roth, 2016/09/20
- [Qemu-stable] [PATCH 08/25] 9pfs: forbid illegal path names, Michael Roth, 2016/09/20
- [Qemu-stable] [PATCH 07/25] net: vmxnet: use g_new for pkt initialisation, Michael Roth, 2016/09/20
- [Qemu-stable] [PATCH 17/25] qemu-char: avoid segfault if user lacks of permisson of a given logfile, Michael Roth, 2016/09/20
- [Qemu-stable] [PATCH 05/25] iscsi: pass SCSI status back for SG_IO, Michael Roth, 2016/09/20
- [Qemu-stable] [PATCH 06/25] net: vmxnet: check IP header length, Michael Roth, 2016/09/20
- [Qemu-stable] [PATCH 16/25] scsi: pvscsi: limit process IO loop to ring size, Michael Roth, 2016/09/20
- [Qemu-stable] [PATCH 23/25] iothread: Stop threads before main() quits, Michael Roth, 2016/09/20
- [Qemu-stable] [PATCH 03/25] virtio: recalculate vq->inuse after migration, Michael Roth, 2016/09/20
- [Qemu-stable] [PATCH 04/25] virtio: decrement vq->inuse in virtqueue_discard(),
Michael Roth <=
- Re: [Qemu-stable] [Qemu-devel] [PATCH 00/25] Patch Round-up for stable 2.6.2, freeze on 2016-08-26, Eric Blake, 2016/09/20
- Re: [Qemu-stable] [PATCH 00/25] Patch Round-up for stable 2.6.2, freeze on 2016-08-26, Michael Roth, 2016/09/20
- Re: [Qemu-stable] [Qemu-devel] [PATCH 00/25] Patch Round-up for stable 2.6.2, freeze on 2016-08-26, John Snow, 2016/09/22