Received: from eggs.gnu.org ([2001:4830:134:3::10]:59690) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZZz19-0000Ux-N8 for qemu-devel@nongnu.org; Thu, 10 Sep 2015 06:23:53 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZZz16-000764-Hg for qemu-devel@nongnu.org; Thu, 10 Sep 2015 06:23:47 -0400 Received: from e06smtp16.uk.ibm.com ([195.75.94.112]:41288) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZZz16-00075j-8x for qemu-devel@nongnu.org; Thu, 10 Sep 2015 06:23:44 -0400 Received: from /spool/local by e06smtp16.uk.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Thu, 10 Sep 2015 11:23:41 +0100 Received: from b06cxnps3074.portsmouth.uk.ibm.com (d06relay09.portsmouth.uk.ibm.com [9.149.109.194]) by d06dlp02.portsmouth.uk.ibm.com (Postfix) with ESMTP id 61DF72190071 for ; Thu, 10 Sep 2015 11:22:28 +0100 (BST) Received: from d06av07.portsmouth.uk.ibm.com (d06av07.portsmouth.uk.ibm.com [9.149.37.248]) by b06cxnps3074.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id t8AAMuH134996376 for ; Thu, 10 Sep 2015 10:22:56 GMT Received: from d06av07.portsmouth.uk.ibm.com (localhost [127.0.0.1]) by d06av07.portsmouth.uk.ibm.com (8.14.4/8.14.4/NCO v10.0 AVout) with ESMTP id t8AAMupl031437 for ; Thu, 10 Sep 2015 04:22:56 -0600 Date: Thu, 10 Sep 2015 12:22:54 +0200 From: Cornelia Huck Message-ID: <20150910122254.090917f6.cornelia.huck@de.ibm.com> In-Reply-To: <20150910120130-mutt-send-email-mst@redhat.com> References: <1441356869-57861-1-git-send-email-cornelia.huck@de.ibm.com> <1441356869-57861-2-git-send-email-cornelia.huck@de.ibm.com> <20150910120130-mutt-send-email-mst@redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH 1/4] virtio: ring sizes vs. reset List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: "Michael S. Tsirkin" Cc: borntraeger@de.ibm.com, jasowang@redhat.com, qemu-devel@nongnu.org On Thu, 10 Sep 2015 12:02:44 +0300 "Michael S. Tsirkin" wrote: > On Fri, Sep 04, 2015 at 10:54:26AM +0200, Cornelia Huck wrote: > > We allow guests to change the size of the virtqueue rings by supplying > > a number of buffers that is different from the number of buffers the > > device was initialized with. Current code has some problems, however, > > since reset does not reset the ringsizes to the default values (as this > > is not saved anywhere). > > > > Let's extend the core code to keep track of the default ringsizes and > > migrate them once the guest changed them for any of the virtqueues > > for a device. > > > > Signed-off-by: Cornelia Huck > > --- > > hw/virtio/virtio.c | 63 ++++++++++++++++++++++++++++++++++++++++++++++ > > include/hw/virtio/virtio.h | 1 + > > 2 files changed, 64 insertions(+) > > > > diff --git a/include/hw/virtio/virtio.h b/include/hw/virtio/virtio.h > > index cccae89..29870c8 100644 > > --- a/include/hw/virtio/virtio.h > > +++ b/include/hw/virtio/virtio.h > > @@ -90,6 +90,7 @@ struct VirtIODevice > > VMChangeStateEntry *vmstate; > > char *bus_name; > > uint8_t device_endian; > > + bool non_default_ringsizes; > > > Let's not try to track this separately. Just go over > rings before migration, and check whether guest changed > anything. I dunno. If we try to figure this out while doing migration, we'll need to go over the rings and check whether any of them has changed, then go over the rings again to save the values - while here, we just set this bool once when the driver changes the value, check once to find out whether we need to migrate the values and reset once. > > > QLIST_HEAD(, VirtQueue) *vector_queues; > > }; > > > > -- > > 2.3.8 >