qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Juan Quintela <quintela@redhat.com>
To: Juha.Riihimaki@nokia.com
Cc: qemu-devel@nongnu.org
Subject: [Qemu-devel] Re: [PATCH 00/20] VMState: port all i2c devices
Date: Mon, 14 Sep 2009 00:35:43 +0200	[thread overview]
Message-ID: <m3bplewk00.fsf@neno.mitica> (raw)
In-Reply-To: <9A1E60B6-5678-4289-91FF-1CC1EB7D6F61@nokia.com> (Juha Riihimaki's message of "Sat, 12 Sep 2009 19:49:06 +0200")

<Juha.Riihimaki@nokia.com> wrote:
> On Sep 11, 2009, at 13:47, ext Juan Quintela wrote:
>
>>>> - i2c->address now are uint8_t, my review of all uses is that they
>>>> are always
>>>> used as uint8_t (and that is the type that is passed on the
>>>> value).  If you know
>>>> i2c, please check.  Change 0002 looks big, but it is because as I  
>>>> was
>>>
>>> I would propose that the address has more than 8 bits to be more
>>> future-proof. After all, the bus addressing has already been extended
>>> to 10 bits: see http://www.i2c-bus.org/addressing/10-bit-addressing/
>>
>> Then we have a field day, and make incompatible versions from now on.
>> VMState use typechecking to make sure that what we save/load has the
>> same type that the variable.  And that was not the case for i2c
>> addresses.  how many users have old machines saved that they want to  
>> restore?
>
> I'm sorry but why is it not possible to start using e.g. 16 bits for  
> the address in the save states from now on and still keep the ability  
> to read save states generated with previous versions? I'm okay with  
> staying on 8 bit addresses only, I would just like to have some solid  
> rationale behind that decision.

It is possible in the Turing sense.  It is not possible in the current
VMSTate sense.

And it is not trivial to do it.  Only thing that I can think of is
passing  version_id to all get functions to be able to decide if address
is 8 bit or 16 bit address.  This get ugly fast.

The other solution that I can think of is adding address_vmstate that is
8 bits (current code), and a new one that is 16 bit.  I think this one
is a bit better (althought not perfect for any means).

In post_load, we do the adjustments (i.e. for older versions, we copy
the value to the new value.

It does'nt matter how we do it, fields changing size is never going to
be pretty.

Is 16 bits enough, or it is going to be needed to get more bits (there
are not so many address fields, getting them to 32bits shouldn't be such
a big deal.

Later, Juan.

      reply	other threads:[~2009-09-13 22:38 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-09-11 10:10 [Qemu-devel] [PATCH 00/20] VMState: port all i2c devices Juan Quintela
2009-09-11 10:10 ` [Qemu-devel] [PATCH 01/20] qdev: Add support for uint8_t Juan Quintela
2009-09-11 10:10 ` [Qemu-devel] [PATCH 02/20] i2c: addresses are load/save as uint8_t values, change types to reflect this Juan Quintela
2009-09-11 10:10 ` [Qemu-devel] [PATCH 03/20] vmstate: port i2c_bus device Juan Quintela
2009-09-11 10:10 ` [Qemu-devel] [PATCH 04/20] vmstate: port i2c_slave device Juan Quintela
2009-09-11 10:10 ` [Qemu-devel] [PATCH 05/20] vmstate: add uint8 array Juan Quintela
2009-09-11 10:10 ` [Qemu-devel] [PATCH 06/20] vmstate: create VMSTATE_I2C_SLAVE Juan Quintela
2009-09-11 10:10 ` [Qemu-devel] [PATCH 07/20] vmstate: port wm8750 device Juan Quintela
2009-09-11 10:10 ` [Qemu-devel] [PATCH 08/20] vmstate: port max7310 device Juan Quintela
2009-09-11 10:10 ` [Qemu-devel] [PATCH 09/20] vmstate: create VMSTATE_STRUCT_POINTER Juan Quintela
2009-09-11 10:10 ` [Qemu-devel] [PATCH 10/20] vmstate: port pxa2xx_i2c device Juan Quintela
2009-09-11 10:10 ` [Qemu-devel] [PATCH 11/20] vmstate: port ssd0303 device Juan Quintela
2009-09-11 10:10 ` [Qemu-devel] [PATCH 12/20] vmstate: create VMSTATE_INT16_ARRAY Juan Quintela
2009-09-11 10:10 ` [Qemu-devel] [PATCH 13/20] tmp105: change len and alorm to uint8_t Juan Quintela
2009-09-11 10:10 ` [Qemu-devel] [PATCH 14/20] vmstate: port wmp105 device Juan Quintela
2009-09-11 10:10 ` [Qemu-devel] [PATCH 15/20] twl92230: change pwrbtn_state to uint8_t Juan Quintela
2009-09-11 10:10 ` [Qemu-devel] [PATCH 16/20] vmstate: port twl92230 device Juan Quintela
2009-09-11 10:10 ` [Qemu-devel] [PATCH 17/20] vmstate: add support for arrays of pointers Juan Quintela
2009-09-11 10:10 ` [Qemu-devel] [PATCH 18/20] lm832x: make fields to have the same types that they are saved/loaded Juan Quintela
2009-09-11 10:10 ` [Qemu-devel] [PATCH 19/20] vmstate: port lm832x device Juan Quintela
2009-09-11 10:10 ` [Qemu-devel] [PATCH 20/20] vmstate: remove i2c_slave_load/save Juan Quintela
2009-09-11 10:31 ` [Qemu-devel] [PATCH 00/20] VMState: port all i2c devices Juha.Riihimaki
2009-09-11 10:47   ` [Qemu-devel] " Juan Quintela
2009-09-12 17:49     ` Juha.Riihimaki
2009-09-13 22:35       ` Juan Quintela [this message]

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=m3bplewk00.fsf@neno.mitica \
    --to=quintela@redhat.com \
    --cc=Juha.Riihimaki@nokia.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).