qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] [PATCH v1 1/6] i2c: support address ranges


From: Peter Crosthwaite
Subject: Re: [Qemu-devel] [PATCH v1 1/6] i2c: support address ranges
Date: Wed, 20 Feb 2013 22:30:52 +1000

On Wed, Feb 20, 2013 at 5:27 PM, Paolo Bonzini <address@hidden> 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

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