From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:36975) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1V8oNh-00058T-Rd for qemu-devel@nongnu.org; Mon, 12 Aug 2013 05:25:48 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1V8oNa-0004rv-1g for qemu-devel@nongnu.org; Mon, 12 Aug 2013 05:25:41 -0400 Received: from mx1.redhat.com ([209.132.183.28]:9622) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1V8oNZ-0004rf-Q1 for qemu-devel@nongnu.org; Mon, 12 Aug 2013 05:25:33 -0400 Date: Mon, 12 Aug 2013 12:27:09 +0300 From: "Michael S. Tsirkin" Message-ID: <20130812092709.GA30782@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Subject: [Qemu-devel] [PATCH for-1.6] vhost: clear signalled_used_valid on vhost stop List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: Paolo Bonzini , Anthony Liguori , Stefan Hajnoczi When vhost device stops, its implementation synchronizes kernel state back to virtio.c so we can continue emulating the device in userspace. This patch ensures that virtio.c's signalled_used_valid flag is reset so that userspace does not suppress guest notifications due to stale signalled_used values. Cc: qemu-stable@nongnu.org Signed-off-by: Michael S. Tsirkin --- hw/virtio/vhost.c | 1 + 1 file changed, 1 insertion(+) diff --git a/hw/virtio/vhost.c b/hw/virtio/vhost.c index 8f6ab13..9e336ad 100644 --- a/hw/virtio/vhost.c +++ b/hw/virtio/vhost.c @@ -762,6 +762,7 @@ static void vhost_virtqueue_stop(struct vhost_dev *dev, fflush(stderr); } virtio_queue_set_last_avail_idx(vdev, idx, state.num); + virtio_queue_invalidate_signalled_used(vdev, idx); assert (r >= 0); cpu_physical_memory_unmap(vq->ring, virtio_queue_get_ring_size(vdev, idx), 0, virtio_queue_get_ring_size(vdev, idx)); -- MST