[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PULL 09/21] pci: Convert to realize
From: |
Eduardo Habkost |
Subject: |
Re: [Qemu-devel] [PULL 09/21] pci: Convert to realize |
Date: |
Fri, 25 Aug 2017 14:49:06 -0300 |
User-agent: |
Mutt/1.8.0 (2017-02-23) |
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 <address@hidden>
> > >
> > > Convert i82801b11, io3130_upstream, io3130_downstream and
> > > pcie_root_port devices to realize.
> > >
> > > Cc: address@hidden
> > > Cc: address@hidden
> > > Cc: address@hidden
> > > Signed-off-by: Mao Zhongyi <address@hidden>
> > > Reviewed-by: Marcel Apfelbaum <address@hidden>
> > > Reviewed-by: Michael S. Tsirkin <address@hidden>
> > > Signed-off-by: Michael S. Tsirkin <address@hidden>
> > > ---
> > [...]
> > > 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