From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:43703) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1blycJ-0006Yt-SE for qemu-devel@nongnu.org; Mon, 19 Sep 2016 09:28:20 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1blycE-00059G-6k for qemu-devel@nongnu.org; Mon, 19 Sep 2016 09:28:14 -0400 Received: from mx1.redhat.com ([209.132.183.28]:53032) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1blycE-000595-0H for qemu-devel@nongnu.org; Mon, 19 Sep 2016 09:28:10 -0400 Received: from int-mx11.intmail.prod.int.phx2.redhat.com (int-mx11.intmail.prod.int.phx2.redhat.com [10.5.11.24]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 846F61824B2 for ; Mon, 19 Sep 2016 13:28:08 +0000 (UTC) From: Stefan Hajnoczi Date: Mon, 19 Sep 2016 14:28:02 +0100 Message-Id: <1474291685-24226-1-git-send-email-stefanha@redhat.com> Subject: [Qemu-devel] [PATCH 0/3] virtio: detach VirtQueueElements freed by reset List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: "Michael S. Tsirkin" , lprosek@redhat.com, Stefan Hajnoczi virtio-blk and virtio-serial need to free VirtQueueElements during device reset. Simply calling g_free(elem) is not enough because the scatter-gather list should be unmapped and vq->inuse must be decremented. These patches address the issue. I am not including a patch that changes vq->inuse = 0 to assert(!vq->inuse) in virtio_reset() yet because virtio-9p, virtio-gpu, and virtio-net have code paths that do not decrement vq->inuse. Stefan Hajnoczi (3): virtio: add virtio_detach_element() virtio-blk: add missing virtio_detach_element() call virtio-serial: add missing virtio_detach_element() call hw/block/virtio-blk.c | 1 + hw/char/virtio-serial-bus.c | 14 ++++++++++++++ hw/virtio/virtio.c | 27 +++++++++++++++++++++++++-- include/hw/virtio/virtio.h | 2 ++ 4 files changed, 42 insertions(+), 2 deletions(-) -- 2.7.4