Blame SOURCES/kvm-virtio-decrement-vq-inuse-in-virtqueue_discard.patch

40b356
From c24e1c927bad95d84e0ffab665baff98d91fb916 Mon Sep 17 00:00:00 2001
40b356
From: Ladi Prosek <lprosek@redhat.com>
40b356
Date: Wed, 5 Oct 2016 17:22:25 +0200
40b356
Subject: [PATCH 3/8] virtio: decrement vq->inuse in virtqueue_discard()
40b356
40b356
RH-Author: Ladi Prosek <lprosek@redhat.com>
40b356
Message-id: <1475666548-9186-4-git-send-email-lprosek@redhat.com>
40b356
Patchwork-id: 72482
40b356
O-Subject: [RHEL-7.4 qemu-kvm v2 PATCH 3/6] virtio: decrement vq->inuse in virtqueue_discard()
40b356
Bugzilla: 1393484
40b356
RH-Acked-by: Paolo Bonzini <pbonzini@redhat.com>
40b356
RH-Acked-by: Michael S. Tsirkin <mst@redhat.com>
40b356
RH-Acked-by: Stefan Hajnoczi <stefanha@redhat.com>
40b356
40b356
From: Stefan Hajnoczi <stefanha@redhat.com>
40b356
40b356
virtqueue_discard() moves vq->last_avail_idx back so the element can be
40b356
popped again.  It's necessary to decrement vq->inuse to avoid "leaking"
40b356
the element count.
40b356
40b356
Cc: qemu-stable@nongnu.org
40b356
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
40b356
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
40b356
Reviewed-by: Cornelia Huck <cornelia.huck@de.ibm.com>
40b356
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
40b356
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
40b356
(cherry picked from commit 58a83c61496eeb0d31571a07a51bc1947e3379ac)
40b356
Signed-off-by: Ladi Prosek <lprosek@redhat.com>
40b356
Signed-off-by: Miroslav Rezanina <mrezanin@redhat.com>
40b356
---
40b356
 hw/virtio/virtio.c | 1 +
40b356
 1 file changed, 1 insertion(+)
40b356
40b356
diff --git a/hw/virtio/virtio.c b/hw/virtio/virtio.c
40b356
index 91c9642..87a7639 100644
40b356
--- a/hw/virtio/virtio.c
40b356
+++ b/hw/virtio/virtio.c
40b356
@@ -255,6 +255,7 @@ void virtqueue_discard(VirtQueue *vq, const VirtQueueElement *elem,
40b356
                        unsigned int len)
40b356
 {
40b356
     vq->last_avail_idx--;
40b356
+    vq->inuse--;
40b356
     virtqueue_unmap_sg(vq, elem, len);
40b356
 }
40b356
 
40b356
-- 
40b356
1.8.3.1
40b356