qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Juan Quintela <quintela@redhat.com>
To: "Michael S. Tsirkin" <mst@redhat.com>
Cc: Gleb Natapov <gleb@redhat.com>, qemu-devel@nongnu.org
Subject: [Qemu-devel] Re: optional feature
Date: Wed, 16 Sep 2009 17:25:11 +0200	[thread overview]
Message-ID: <m3skemhpyg.fsf@neno.mitica> (raw)
In-Reply-To: <20090916151143.GB5513@redhat.com> (Michael S. Tsirkin's message of "Wed, 16 Sep 2009 18:11:44 +0300")

"Michael S. Tsirkin" <mst@redhat.com> wrote:
> On Wed, Sep 16, 2009 at 04:53:47PM +0200, Juan Quintela wrote:
>> > It is more modular.  With optional features A B C, versioning can not
>> > support saving only A and C but not B.  This is bad for example for
>> > backporting features between versions: if C happened to be introduced
>> > after B, backporting C will force backporting B.
>> 
>> No problem again.
>> You backport, and you add to the state both B and C.  You just don't
>> care about B values.  I leave you a name for them:
>> 
>> reserved0
>> reserved1
>> reserved2
>> 
>> And you are done.
>
> Not really. When you save, B has an invalid value.
> Load it in upstream qemu, boom.

You are donig the backport or only C, you have to be able to put
sensible values here.

>> And what is worse, what happens when you have to upgrade B and C with
>> new fields?  Now you have:
>> 
>> A, B, B', C, C'
>> 
>> And what options are valid?  How you differentiate between B and B', C
>> and C', a version number?
>
> Each is a new feature.
> If B' relaces B, then do not store B, store only B'.

Backward compatibility was the whole game, do you remember?  If I can
remove backward compatiblity, at least half of the problems dissapear.

>>  We are back at stage 1?
>> 
>> And how many features do you support?  Exponential again.
>
> Nothing exponential. Test with each feature on and off, you are done.

1 features 2 test
2 features 4 tests
4 features 16 tests

it looks very exponential to me.  You need to test all combinations.
You are the one wanting to be able to use all combinations.

>> With linear version numbers you are going to have:
>> 
>> A
>> A+B
>> A+B+C
>> A+B'+C
>> A+B'+C'
>
> This is exponential in the number of combinations you need to code up.

No, you only code the ones that I showed.  You are done.

>> (you can switch the 2 last ones depending the order in which changes
>> happen).  And that is it, no exponential cases again.  we added 4
>> features and we have 4 new versions.  It looks very linear to me.
>> And we can still load all the previous versions.
>> 
>> > But you can support it if you put each one in a migration container.
>> 
>> My opinion: We don't even want to think about this.
>> 
>> 
>> > if you are not saving irq state, it's better
>> > to skip the array that create a 0 size array.
>> 
>> Why?
>
> Because of what I said below: it does not work for non-arrays.

For non arrays it is easier, you just put the value there.  No problem
at all.  You are saving a 512MB (at minimum) image, believe me, 20 bytes
more/less are not going to matter.

>> > The former works for non-array fields, the later does not,
>> > and you have to invent a separate valid bit.
>> 
>> VMStateDescription, think of it as a contract.  Would you like that the
>> other part would be able to insert whole paragraphs when he wants?
>> Without ever telling you that it changed (i.e. same version).
>
> Yes, it has to tell me

How, where?

>, each option should be tagged.

how?

> I see a new paragraph, I do not recognize it, I abort.

>> I don't think so.  I am sure I would preffer that it will told me
>> clearly that contract changed (new version), and the changes are this,
>> this and this.
>
> It does not though. The connection between versions and
> sets of features is scattered over the code.
> Instead, the format should be self-documenting.

Wait, I thought you were the one wanting backward compatibility.  Now,
we want a different format.  And how are you going to send that to an
old version?  Format is what it is.  I can't understand your switch
here, sorry.

1st: you want to send blobs, and you make sure that you understand what
     you send, vmstate is just a transport.
2nd: you want to be able to pick what features you want/don't want, set
     the save version number, and expect that the other side is able to
     understand.  You explicitely wanted to be able to send for a newer
     qemu version in a device with more features to an old qemu version
     with an device with less features.
3rd: Now you want a different format, where backward compatibility
     obviously dissapear.

Sorry, I can't follow you.

Later, Juan.

  reply	other threads:[~2009-09-16 15:25 UTC|newest]

Thread overview: 33+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-09-16 10:46 [Qemu-devel] optional feature (was Re: The State of the SaveVM format) Michael S. Tsirkin
2009-09-16 11:04 ` [Qemu-devel] Re: optional feature Juan Quintela
2009-09-16 11:18   ` Gleb Natapov
2009-09-16 11:48     ` Juan Quintela
2009-09-16 11:52       ` Michael S. Tsirkin
2009-09-16 12:14         ` Juan Quintela
2009-09-16 12:18           ` Michael S. Tsirkin
2009-09-16 12:26             ` Juan Quintela
2009-09-16 12:37               ` Michael S. Tsirkin
2009-09-16 13:01                 ` Juan Quintela
2009-09-16 13:03                   ` Michael S. Tsirkin
2009-09-16 13:34                     ` Juan Quintela
2009-09-16 14:02                       ` Michael S. Tsirkin
2009-09-16 11:57       ` Gleb Natapov
2009-09-16 12:23         ` Juan Quintela
2009-09-16 12:35           ` Gleb Natapov
2009-09-16 12:40             ` Michael S. Tsirkin
2009-09-16 13:22             ` Juan Quintela
2009-09-16 14:08               ` Anthony Liguori
2009-09-16 14:12                 ` Michael S. Tsirkin
2009-09-16 14:21                   ` Anthony Liguori
2009-09-16 14:34                     ` Michael S. Tsirkin
2009-09-16 14:53                       ` Juan Quintela
2009-09-16 15:11                         ` Michael S. Tsirkin
2009-09-16 15:25                           ` Juan Quintela [this message]
2009-09-16 15:45                       ` Anthony Liguori
2009-09-16 15:58                         ` Anthony Liguori
2009-09-16 13:51         ` Anthony Liguori
2009-09-16 11:41   ` Michael S. Tsirkin
2009-09-16 12:13     ` Juan Quintela
2009-09-16 12:29       ` Michael S. Tsirkin
2009-09-16 13:31         ` Juan Quintela
2009-09-16 14:07           ` Michael S. Tsirkin

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=m3skemhpyg.fsf@neno.mitica \
    --to=quintela@redhat.com \
    --cc=gleb@redhat.com \
    --cc=mst@redhat.com \
    --cc=qemu-devel@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).