From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:44232) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bheet-0000s6-C2 for qemu-devel@nongnu.org; Wed, 07 Sep 2016 11:21:04 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bheep-0003Px-5E for qemu-devel@nongnu.org; Wed, 07 Sep 2016 11:21:02 -0400 Received: from mx1.redhat.com ([209.132.183.28]:57454) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bheeo-0003Po-W6 for qemu-devel@nongnu.org; Wed, 07 Sep 2016 11:20:59 -0400 From: Ladi Prosek Date: Wed, 7 Sep 2016 17:20:46 +0200 Message-Id: <1473261649-31465-1-git-send-email-lprosek@redhat.com> Subject: [Qemu-devel] [PATCH 0/3] virtio-balloon: stats vq fixes List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: mst@redhat.com, rkagan@virtuozzo.com, stefanha@redhat.com, lprosek@redhat.com This is another series that aims to fix issues with the balloon stats queue, heavily inspired by previous patches posted by Stefan and Roman. Stefan Hajnoczi (1): virtio: add virtqueue_rewind() Ladi Prosek (2): virtio-balloon: discard virtqueue element on reset virtio-balloon: fix stats vq migration The first patch addresses the "inuse leak" issue which was discovered recently. The virtqueue_rewind() implementation is reposted verbatim. However, it is called from the set_status callback, same as in Roman's patch. Doing it in balloon_stats_poll_cb (Stefan's patch) is potentially problematic because the guest may push another buffer to the queue before the timer fires, so we could still leak a virtqueue slot. Also, we want to call the full-blown virtio_balloon_receive_stats and not manually reconstruct only some pieces of the state. It is not necessary to check balloon_stats_supported. Pushing buffers without negotiating stats support would be a driver bug. The common codepath does not check it either.