Thanks
On Thu, Nov 24, 2011 at 9:40 AM, Avi Kivity wrote:
> On 11/23/2011 01:03 AM, Peter Maydell wrote:
> > 2011/11/22 Benoît Canet :
> > > static int bonito_initfn(PCIDevice *dev)
> > > {
> > > PCIBonitoState *s = DO_UPCAST(PCIBonitoState, dev, dev);
> > > +SysBusDevice *sysbus = sys
On 11/23/2011 01:03 AM, Peter Maydell wrote:
> 2011/11/22 Benoît Canet :
> > static int bonito_initfn(PCIDevice *dev)
> > {
> > PCIBonitoState *s = DO_UPCAST(PCIBonitoState, dev, dev);
> > +SysBusDevice *sysbus = sysbus_from_qdev(&dev->qdev);
>
> This looks odd. The device here is a PCIBo
2011/11/23 Benoît Canet :
> It would work using memory_region_add_subregion() and get_system_memory()
> but Avi previously noticed me that using get_system_memory() in devices
> is wrong because it goes against one of the goals of the memory API :
> avoiding global knowledge.
Yes. It's a bit diffi
2011/11/23 Peter Maydell
> 2011/11/22 Benoît Canet :
> > static int bonito_initfn(PCIDevice *dev)
> > {
> > PCIBonitoState *s = DO_UPCAST(PCIBonitoState, dev, dev);
> > +SysBusDevice *sysbus = sysbus_from_qdev(&dev->qdev);
>
> This looks odd. The device here is a PCIBonitoState, which
>
2011/11/22 Benoît Canet :
> static int bonito_initfn(PCIDevice *dev)
> {
> PCIBonitoState *s = DO_UPCAST(PCIBonitoState, dev, dev);
> + SysBusDevice *sysbus = sysbus_from_qdev(&dev->qdev);
This looks odd. The device here is a PCIBonitoState, which
is-a PCIDevice, which is-a DeviceState. I
Signed-off-by: Benoît Canet
---
hw/bonito.c | 39 ++-
1 files changed, 18 insertions(+), 21 deletions(-)
diff --git a/hw/bonito.c b/hw/bonito.c
index fdb8198..9260848 100644
--- a/hw/bonito.c
+++ b/hw/bonito.c
@@ -201,9 +201,7 @@ typedef struct PCIBonitoStat