On Wed, Feb 20, 2013 at 5:27 PM, Paolo Bonzini <pbonz...@redhat.com> wrote:
> Il 20/02/2013 06:29, Peter Crosthwaite ha scritto:
>> @@ -192,12 +197,13 @@ static int i2c_slave_post_load(void *opaque, int 
>> version_id)
>>
>>  const VMStateDescription vmstate_i2c_slave = {
>>      .name = "I2CSlave",
>> -    .version_id = 1,
>> -    .minimum_version_id = 1,
>> -    .minimum_version_id_old = 1,
>> +    .version_id = 2,
>> +    .minimum_version_id = 2,
>> +    .minimum_version_id_old = 2,
>>      .post_load = i2c_slave_post_load,
>>      .fields      = (VMStateField []) {
>>          VMSTATE_UINT8(address, I2CSlave),
>> +        VMSTATE_UINT8(address_range, I2CSlave),
>>          VMSTATE_END_OF_LIST()
>
> Properties do not need to be serialized.
>

Ok,

I do wonder why the address itselt in VMSDs however and my best guess
is the intention is that devices can modify their address at runtime
(phyiscally very possible and valid with I2C). So what happens if a
device changes the value of one of its props at runtime? E.G. in this
case what happens if my device decides to change its I2CSlave->address
in response to some arbitrary event? Will that play foul with VMSD or
can i just save the prop in my VMSD with the rest of my device state
to implement restoration of the modified prop?

Regards,
Peter

> Paolo
>

Reply via email to