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: Paolo Bonzini
Subject: Re: [Qemu-devel] [PATCH v1 1/6] i2c: support address ranges
Date: Wed, 20 Feb 2013 14:04:52 +0100
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20130110 Thunderbird/17.0.2

Il 20/02/2013 13:30, Peter Crosthwaite ha scritto:
> 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?

Ok, in this case this would be valid, but the implementation is still a
bit weird.  What is the behavior on reset?  Should it go back to the
original value of the address?

If so, you need to use a separate variable to store the initial value of
the address and the current value.  Then the initial value is immutable
and thus not serialized; the current value instead is part of the
VMState.  More importantly, the reset callback can then reset the
current address back to the initial value.

Paolo



reply via email to

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