qemu-devel
[Top][All Lists]
Advanced

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

[Qemu-devel] Re: optional feature


From: Michael S. Tsirkin
Subject: [Qemu-devel] Re: optional feature
Date: Wed, 16 Sep 2009 15:37:10 +0300
User-agent: Mutt/1.5.19 (2009-01-05)

On Wed, Sep 16, 2009 at 02:26:58PM +0200, Juan Quintela wrote:
> "Michael S. Tsirkin" <address@hidden> wrote:
> > On Wed, Sep 16, 2009 at 02:14:32PM +0200, Juan Quintela wrote:
> >> >> See below, we are changing the state to one table, and tables don't have
> >> >> neither if's or whiles (we have a limited for that just walks arrays).
> >> >
> >> > Let's just bite the bullet and add support for if's?  It's not like it's
> >> > hard to invent 'struct vmstate_condition' or some such.
> >> 
> >> I have to do it.  The problem is not adding an optional field, is adding
> >> it conditionally on _what_, and that _what_ should also be ideally on 
> >> vmstate.
> >> 
> >> Later, Juan.
> >
> > pci config is on vmstate already, I don't see a problem here.
> 
> vmstate don't understand pci config.

How can it save it then? What's more, how can it load it sanely? E.g.
when loading we must make sure that device id etc match.

> I want to manipulate images with
> the informantion that you have given vmstate.  Sending another byte
> meaning:
> 
> msix_enabled
> 
> and now depending on that value another field is ok with me.

1. this bit is there in config already.
   sending it twice is redundant and so, wrong:
   we will just have to add even more code
   to check that these values match
2. it's also not backward compatible, is it?

> You can
> calculate msix_enable at pre_save time whenever way that you see fit.

Not everything has to fit in a global variable, we can have a table
per-device. Then each time msix_enable bit is changed, I can tell
vmstate about it.

> What vmstate needs is a only to now if msix_enable is 0 or 1, how you
> calculate it, VMState don't care.

Add a condition including offset into pci config and bitmask?

> Later, Juan.




reply via email to

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