On 04/30/2012 08:36 AM, Avi Kivity wrote:
On 04/30/2012 04:27 PM, Peter Maydell wrote:
On 30 April 2012 14:23, Avi Kivity<a...@redhat.com> wrote:
IMO the best fix is to unsysbus the device and qomify it instead. This
way we're 100% flexible in how we can attach it.
You don't need to wait for QOM to grow enough features to
replace sysbus. If you don't like what sysbus_mmio_map() does, you
can always use sysbus_mmio_get_region() to get the MemoryRegion* and
then deal with it however you need to. This is the standard way
to deal with "I have a sysbus device which I want to map into my
custom container object".
I believe that API voids you warrantee.
All that a "QOM" conversion would do is eliminate the use of sysbus and derive
the object directly from DeviceState. Then, you would map the MemoryRegion
exported by the device directly.
So sysbus_mmio_get_region() seems like the right API to use.
Regards,
Anthony Liguori