From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:35164) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1StICY-0007rS-Kl for qemu-devel@nongnu.org; Mon, 23 Jul 2012 08:57:35 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1StICT-0003Vo-5G for qemu-devel@nongnu.org; Mon, 23 Jul 2012 08:57:30 -0400 Received: from cantor2.suse.de ([195.135.220.15]:55615 helo=mx2.suse.de) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1StICS-0003Ve-Rh for qemu-devel@nongnu.org; Mon, 23 Jul 2012 08:57:25 -0400 Message-ID: <500D4A30.6050402@suse.de> Date: Mon, 23 Jul 2012 14:57:20 +0200 From: =?ISO-8859-15?Q?Andreas_F=E4rber?= MIME-Version: 1.0 References: <1343046959-6659-1-git-send-email-liwanp@linux.vnet.ibm.com> <1343046959-6659-4-git-send-email-liwanp@linux.vnet.ibm.com> In-Reply-To: <1343046959-6659-4-git-send-email-liwanp@linux.vnet.ibm.com> Content-Type: text/plain; charset=ISO-8859-15 Content-Transfer-Encoding: quoted-printable Subject: Re: [Qemu-devel] [PATCH v5 3/3] convert pci-host to QOM List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Wanpeng Li Cc: Anthony Liguori , Gavin Shan , "Michael S. Tsirkin" , Jan Kiszka , qemu-devel@nongnu.org, Ram Pai , Blue Swirl , Stefan Weil , Liu Ping Fan , Paolo Bonzini , Avi Kivity Am 23.07.2012 14:35, schrieb Wanpeng Li: > From: Anthony Liguori >=20 > makes pci_host a proper QOM type. >=20 > Changelog: > * against Andreas pci_host branch > * make host bridge TypeInfos const > * use PCI_HOST_BRIDGE() where appropriate=20 >=20 > Signed-off-by: Anthony Liguori > Signed-off-by: Wanpeng Li >=20 > --- > hw/i440fx.c | 6 +++--- > hw/pc.c | 2 +- > hw/pci_host.c | 14 ++++++++++++++ > hw/pci_host.h | 2 ++ > hw/piix3.c | 4 ++-- > 5 files changed, 22 insertions(+), 6 deletions(-) >=20 > diff --git a/hw/i440fx.c b/hw/i440fx.c > index 720a25a..fdf040b 100644 > --- a/hw/i440fx.c > +++ b/hw/i440fx.c > @@ -191,7 +191,7 @@ static const VMStateDescription vmstate_i440fx_pmc = =3D { > static int i440fx_realize(SysBusDevice *dev) > { > I440FXState *s =3D I440FX(dev); > - PCIHostState *h =3D PCI_HOST(s); > + PCIHostState *h =3D PCI_HOST_BRIDGE(s); > int bios_size, isa_bios_size; > char *filename; > int ret; Either there's a miscommunication or a technical error: My branch surely is using PCI_HOST_BRIDGE(), so these PCI_HOST -> PCI_HOST_BRIDGE changes look bogus. Did you make sure each patch compiles? > @@ -401,7 +401,7 @@ static void i440fx_pmc_class_init(ObjectClass *klas= s, void *data) > dc->vmsd =3D &vmstate_i440fx_pmc; > } > =20 > -static TypeInfo i440fx_pmc_info =3D { > +static const TypeInfo i440fx_pmc_info =3D { > .name =3D TYPE_I440FX_PMC, > .parent =3D TYPE_PCI_DEVICE, > .instance_size =3D sizeof(I440FXPMCState), > @@ -418,7 +418,7 @@ static void i440fx_class_init(ObjectClass *klass, v= oid *data) > dc->no_user =3D 1; > } > =20 > -static TypeInfo i440fx_info =3D { > +static const TypeInfo i440fx_info =3D { > .name =3D TYPE_I440FX, > .parent =3D TYPE_PCI_HOST_BRIDGE, > .instance_size =3D sizeof(I440FXState), Patch 1/3 does not have const, patch 2/3 adds new TypeInfos without const= . So my guess is you've not rebased this on my pci-host branch [1] but onto something else? If they're not against master it's advisable to mark patches [PATCH treename xx/nn] btw, for clarity. For the new/changed TypeInfos please add const from the start. Regards, Andreas [1] http://repo.or.cz/w/qemu/afaerber.git/shortlog/refs/heads/pci-host git://repo.or.cz/qemu/afaerber.git pci-host > diff --git a/hw/pc.c b/hw/pc.c > index d9a0443..f095109 100644 > --- a/hw/pc.c > +++ b/hw/pc.c > @@ -1217,7 +1217,7 @@ static PCIBus *i440fx_init(I440FXPMCState **pi440= fx_state, int *piix3_devfn, > PCIHostState *h; > =20 > s =3D I440FX(object_new(TYPE_I440FX)); > - h =3D PCI_HOST(s); > + h =3D PCI_HOST_BRIDGE(s); > =20 > /* FIXME make a properties */ > h->address_space =3D address_space_mem; > diff --git a/hw/pci_host.c b/hw/pci_host.c > index 3950e94..4e10042 100644 > --- a/hw/pci_host.c > +++ b/hw/pci_host.c > @@ -165,11 +165,25 @@ const MemoryRegionOps pci_host_data_be_ops =3D { > .endianness =3D DEVICE_BIG_ENDIAN, > }; > =20 > +void pci_host_set_mmio(PCIHostState *s, MemoryRegion *value) > +{ > + object_property_set_link(OBJECT(s), OBJECT(value), "mmio", NULL); > +} > + > +static void pci_host_initfn(Object *obj) > +{ > + PCIHostState *s =3D PCI_HOST_BRIDGE(obj); > + > + object_property_add_link(obj, "mmio", "memory-region", > + (Object **)&s->address_space, NULL); > +} > + > static const TypeInfo pci_host_type_info =3D { > .name =3D TYPE_PCI_HOST_BRIDGE, > .parent =3D TYPE_SYS_BUS_DEVICE, > .abstract =3D true, > .instance_size =3D sizeof(PCIHostState), > + .instance_init =3D pci_host_initfn, > }; > =20 > static void pci_host_register_types(void) > diff --git a/hw/pci_host.h b/hw/pci_host.h > index 4b9c300..9f28728 100644 > --- a/hw/pci_host.h > +++ b/hw/pci_host.h > @@ -54,6 +54,8 @@ uint32_t pci_host_config_read_common(PCIDevice *pci_d= ev, uint32_t addr, > void pci_data_write(PCIBus *s, uint32_t addr, uint32_t val, int len); > uint32_t pci_data_read(PCIBus *s, uint32_t addr, int len); > =20 > +void pci_host_set_mmio(PCIHostState *s, MemoryRegion *value); > + > extern const MemoryRegionOps pci_host_conf_le_ops; > extern const MemoryRegionOps pci_host_conf_be_ops; > extern const MemoryRegionOps pci_host_data_le_ops; > diff --git a/hw/piix3.c b/hw/piix3.c > index eca6ec8..3b69b15 100644 > --- a/hw/piix3.c > +++ b/hw/piix3.c > @@ -204,7 +204,7 @@ static void piix3_class_init(ObjectClass *klass, vo= id *data) > k->class_id =3D PCI_CLASS_BRIDGE_ISA; > } > =20 > -static TypeInfo piix3_info =3D { > +static const TypeInfo piix3_info =3D { > .name =3D TYPE_PIIX3, > .parent =3D TYPE_PCI_DEVICE, > .instance_size =3D sizeof(PIIX3State), > @@ -219,7 +219,7 @@ static void piix3_xen_class_init(ObjectClass *klass= , void *data) > k->config_write =3D piix3_write_config_xen; > }; > =20 > -static TypeInfo piix3_xen_info =3D { > +static const TypeInfo piix3_xen_info =3D { > .name =3D "PIIX3-xen", > .parent =3D TYPE_PIIX3, > .instance_size =3D sizeof(PIIX3State), >=20 --=20 SUSE LINUX Products GmbH, Maxfeldstr. 5, 90409 N=FCrnberg, Germany GF: Jeff Hawn, Jennifer Guild, Felix Imend=F6rffer; HRB 16746 AG N=FCrnbe= rg