On Fri, Aug 25, 2017 at 07:57:57PM +0300, Michael S. Tsirkin wrote: > On Fri, Aug 25, 2017 at 12:17:42PM -0300, Eduardo Habkost wrote: > > On Mon, Jul 03, 2017 at 10:45:16PM +0300, Michael S. Tsirkin wrote: > > > From: Mao Zhongyi <maozy.f...@cn.fujitsu.com> > > > > > > Convert i82801b11, io3130_upstream, io3130_downstream and > > > pcie_root_port devices to realize. > > > > > > Cc: m...@redhat.com > > > Cc: mar...@redhat.com > > > Cc: arm...@redhat.com > > > Signed-off-by: Mao Zhongyi <maozy.f...@cn.fujitsu.com> > > > Reviewed-by: Marcel Apfelbaum <mar...@redhat.com> > > > Reviewed-by: Michael S. Tsirkin <m...@redhat.com> > > > Signed-off-by: Michael S. Tsirkin <m...@redhat.com> > > > --- > > [...] > > > diff --git a/hw/pci-bridge/xio3130_downstream.c > > > b/hw/pci-bridge/xio3130_downstream.c > > > index cfe8a36..e706f36 100644 > > > --- a/hw/pci-bridge/xio3130_downstream.c > > > +++ b/hw/pci-bridge/xio3130_downstream.c > > > @@ -56,33 +56,33 @@ static void xio3130_downstream_reset(DeviceState > > > *qdev) > > > pci_bridge_reset(qdev); > > > } > > > > > > -static int xio3130_downstream_initfn(PCIDevice *d) > > > +static void xio3130_downstream_realize(PCIDevice *d, Error **errp) > > > { > > [...] > > > pcie_chassis_create(s->chassis); > > > rc = pcie_chassis_add_slot(s); > > > if (rc < 0) { > > > goto err_pcie_cap; > > > > Missing error_setg() call here. If pcie_chassis_add_slot() fails, realize > > won't report an error properly. Causes crash with: > > > > $ ./x86_64-softmmu/qemu-system-x86_64 -device ioh3420 -device > > xio3130-downstream > > qemu-system-x86_64: /home/ehabkost/rh/proj/virt/qemu/memory.c:2166: > > memory_region_del_subregion: Assertion `subregion->container == mr' failed. > > Aborted (core dumped) > > > > > > > } > > > > > > rc = pcie_aer_init(d, PCI_ERR_VER, XIO3130_AER_OFFSET, > > > - PCI_ERR_SIZEOF, &err); > > > + PCI_ERR_SIZEOF, errp); > > > if (rc < 0) { > > > - error_report_err(err); > > > goto err; > > > } > > > > > > - return 0; > > > + return; > > > > > > err: > > > pcie_chassis_del_slot(s); > > > @@ -114,7 +113,6 @@ err_msi: > > > msi_uninit(d); > > > err_bridge: > > > pci_bridge_exitfn(d); > > > - return rc; > > > } > > > > > [...] > > Good catch! Patch?
I will send one later today. -- Eduardo