qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] [PATCH 3/3] pcie: using error_setg instead of impolite


From: Gonglei (Arei)
Subject: Re: [Qemu-devel] [PATCH 3/3] pcie: using error_setg instead of impolite assert
Date: Wed, 20 Aug 2014 02:54:46 +0000

> -----Original Message-----
> From: address@hidden
> [mailto:address@hidden On Behalf Of Peter Crosthwaite
> Sent: Tuesday, August 19, 2014 9:51 PM
> To: Gonglei (Arei)
> Cc: address@hidden Developers; Huangweidong (C); Michael S. Tsirkin;
> Huangpeng (Peter); Igor Mammedov; Paolo Bonzini; Andreas Färber
> Subject: Re: [Qemu-devel] [PATCH 3/3] pcie: using error_setg instead of
> impolite assert
> 
> Add "hotplug" to the subject line somewhere.
> 
OK.
> 
> On Tue, Aug 19, 2014 at 7:41 PM,  <address@hidden> wrote:
> > From: Gonglei <address@hidden>
> >
> > It's enough of reporting an error. Assert() is not acceptable
> 
> "It's enough to report an error".
> 
OK.

Thanks, Peter.

I'm waiting for MST's explicit comment for this patch.
If ok, will send v2, otherwise will drop it.

Best regards,
-Gonglei
 
> Regards,
> Peter
> 
> > because the error is not a fatal error.
> >
> > Signed-off-by: Gonglei <address@hidden>
> > ---
> >  hw/pci/pcie.c | 6 +++++-
> >  1 file changed, 5 insertions(+), 1 deletion(-)
> >
> > diff --git a/hw/pci/pcie.c b/hw/pci/pcie.c
> > index a123c01..7b46140 100644
> > --- a/hw/pci/pcie.c
> > +++ b/hw/pci/pcie.c
> > @@ -254,7 +254,11 @@ void pcie_cap_slot_hotplug_cb(HotplugHandler
> *hotplug_dev, DeviceState *dev,
> >       * Right now, only a device of function = 0 is allowed to be
> >       * hot plugged/unplugged.
> >       */
> > -    assert(PCI_FUNC(pci_dev->devfn) == 0);
> > +    if (PCI_FUNC(pci_dev->devfn) != 0) {
> > +        error_setg(errp, "Unsupported device function %d for PCIe
> hotplugging, "
> > +                   "only supported function 0",
> PCI_FUNC(pci_dev->devfn));
> > +        return;
> > +    }
> >
> >      pci_word_test_and_set_mask(exp_cap + PCI_EXP_SLTSTA,
> >                                 PCI_EXP_SLTSTA_PDS);
> > --
> > 1.7.12.4
> >
> >
> >

reply via email to

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