qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH] qdev: hook up i440fx pcihost to system bus.


From: Paul Brook
Subject: Re: [Qemu-devel] [PATCH] qdev: hook up i440fx pcihost to system bus.
Date: Mon, 8 Jun 2009 15:53:14 +0100
User-agent: KMail/1.11.4 (Linux/2.6.29-2-amd64; KDE/4.2.4; x86_64; ; )

On Monday 08 June 2009, Gerd Hoffmann wrote:
> On 06/08/09 15:04, Paul Brook wrote:
> >> typedef struct {
> >> +    DeviceState qdev;
> >> ...
> >> +static struct DeviceInfo i440fx_pcihost_devinfo = {
> >> +    .init = i440fx_initfn,
> >> +    .bus_type = BUS_TYPE_SYSTEM,
> >> +};
> >
> > This is clearly a lie.
>
> --verbose please.

If you're adding something to a system bus, it needs to be a system bus device 
(i.e. SysBusDevice and use sysbus_register_*). The FROM_SYSBUS and similar 
macros help to protect agains mixing the wrong things, hence my later comment.

You should never be setting bus_type directly. It will be done by the 
appropriate bus wrappers.  The comment at the top of qdev.c hints towards 
this:

    Devices will generally inherit from a particular bus (e.g. PCI or I2C)
    rather than this API directly.

Paul




reply via email to

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