qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH 1/4] virtio: ring sizes vs. reset


From: Michael S. Tsirkin
Subject: Re: [Qemu-devel] [PATCH 1/4] virtio: ring sizes vs. reset
Date: Thu, 10 Sep 2015 13:43:46 +0300

On Thu, Sep 10, 2015 at 12:22:54PM +0200, Cornelia Huck wrote:
> On Thu, 10 Sep 2015 12:02:44 +0300
> "Michael S. Tsirkin" <address@hidden> 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 <address@hidden>
> > > ---
> > >  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.

Then restore it on load ...
State is worse than stateless, without a state you are
never out of sync.

> > 
> > >      QLIST_HEAD(, VirtQueue) *vector_queues;
> > >  };
> > >  
> > > -- 
> > > 2.3.8
> > 



reply via email to

[Prev in Thread] Current Thread [Next in Thread]