[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
- [Qemu-devel] [PATCH v1 0/6] Xilinx Zynq I2C, Peter Crosthwaite, 2013/02/20
- [Qemu-devel] [PATCH v1 1/6] i2c: support address ranges, Peter Crosthwaite, 2013/02/20
- [Qemu-devel] [PATCH v1 2/6] i2c: Add no_init version of i2c_create_slave, Peter Crosthwaite, 2013/02/20
- [Qemu-devel] [PATCH v1 3/6] cadence_i2c: first revision, Peter Crosthwaite, 2013/02/20
- [Qemu-devel] [PATCH v1 4/6] hw: M24Cxx I2C EEPROM device model, Peter Crosthwaite, 2013/02/20
- [Qemu-devel] [PATCH v1 5/6] hw: pca9548: Device model, Peter Crosthwaite, 2013/02/20
- [Qemu-devel] [PATCH v1 6/6] xilinx_zynq: Add i2c components, Peter Crosthwaite, 2013/02/20