From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:33068) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XPAsM-0006nD-3d for qemu-devel@nongnu.org; Wed, 03 Sep 2014 09:45:34 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XPAsH-0004f2-9N for qemu-devel@nongnu.org; Wed, 03 Sep 2014 09:45:30 -0400 Received: from mx1.redhat.com ([209.132.183.28]:52721) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XPAsH-0004eq-2t for qemu-devel@nongnu.org; Wed, 03 Sep 2014 09:45:25 -0400 Date: Wed, 3 Sep 2014 16:48:26 +0300 From: "Michael S. Tsirkin" Message-ID: <20140903134826.GA15485@redhat.com> References: <1409659388-9404-1-git-send-email-arei.gonglei@huawei.com> <1409659388-9404-5-git-send-email-arei.gonglei@huawei.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1409659388-9404-5-git-send-email-arei.gonglei@huawei.com> Subject: Re: [Qemu-devel] [PATCH v5 4/4] pcie: don't assert when hotplug a PCIe device with 'function != 0' List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: arei.gonglei@huawei.com Cc: peter.crosthwaite@xilinx.com, weidong.huang@huawei.com, luonengjun@huawei.com, qemu-devel@nongnu.org, peter.huangpeng@huawei.com, imammedo@redhat.com, pbonzini@redhat.com, afaerber@suse.de On Tue, Sep 02, 2014 at 08:03:08PM +0800, arei.gonglei@huawei.com wrote: > From: Gonglei > > It's enough to report an error. Assert() is not acceptable > because the error is not a fatal error. > > Signed-off-by: Gonglei I think it's an unrelated issue, don't send this as part of a bugfix qdev patchset pls. > --- > 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 1babddf..ab7f8a2 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 >