On Tue, Jun 14, 2011 at 12:09 AM, Andreas Färber <andreas.faer...@web.de> wrote: > Am 13.06.2011 um 22:08 schrieb Blue Swirl: > >> On Wed, Jun 8, 2011 at 9:55 PM, Andreas Färber <andreas.faer...@web.de> >> wrote: >>> >>> I've refined the series to track the state in ISADevice and to expose it >>> as VMState. >>> Error handling has been improved, and setting the state multiple times is >>> no-op now. >>> >>> To read the state, I'm introducing support for bool qdev properties. >>> Some more qdev_prop_get_*() helpers are introduced, too. >>> >>> Still need to do some runtime testing, but I'd like to hear if this is >>> getting >>> mergeable now, especially wrt VMState. >>> >>> Andreas >>> >>> >>> Andreas Färber (11): >>> qdev: Add support for property type bool >>> qdev: Add helpers for reading properties >>> isa: Provide set_state callback >>> isa: Allow to un-assign I/O ports >>> isa: Allow to un-associate an IRQ >> >> I like the patches above. >> >> But I think the set_state() interface could be improved. For example, >> cpu_register_io_memory() gives an index which is passed to >> sysbus_register_mmio(). Then the board can instantiate the device at >> desired location without caring about the device internals. With >> set_state(), the device does everything. > > Thanks. On IRC, Juan proposed to replace set_state with enable and disable, > that's what I hope to post together with VMStateSubsections tonight, as part > of the large PReP series. > > Your proposal I don't understand yet. The ioport handlers are > device-specific, so must be registered from within the device. We discussed > consolidating that into helpers at ISA level to avoid one call, Gleb further > suggested converting to IORange. We can't do that declaratively since some > are conditional.
Yes, I would have wanted something declarative. But maybe ISA is special then.