From: "Michael S. Tsirkin" <mst@redhat.com>
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
Subject: Re: [Qemu-devel] [PATCH v5 4/4] pcie: don't assert when hotplug a PCIe device with 'function != 0'
Date: Wed, 3 Sep 2014 16:48:26 +0300 [thread overview]
Message-ID: <20140903134826.GA15485@redhat.com> (raw)
In-Reply-To: <1409659388-9404-5-git-send-email-arei.gonglei@huawei.com>
On Tue, Sep 02, 2014 at 08:03:08PM +0800, arei.gonglei@huawei.com wrote:
> From: Gonglei <arei.gonglei@huawei.com>
>
> It's enough to report an error. Assert() is not acceptable
> because the error is not a fatal error.
>
> Signed-off-by: Gonglei <arei.gonglei@huawei.com>
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
>
next prev parent reply other threads:[~2014-09-03 13:45 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-09-02 12:03 [Qemu-devel] [PATCH v5 0/4] Refactor device_set_realized to avoid resource leak arei.gonglei
2014-09-02 12:03 ` [Qemu-devel] [PATCH v5 1/4] qdev: using error_abort instead of using local_err arei.gonglei
2014-09-03 14:29 ` Andreas Färber
2014-09-04 1:03 ` Gonglei (Arei)
2014-09-02 12:03 ` [Qemu-devel] [PATCH v5 2/4] qdev: using NULL instead of local_err for qbus_child unrealize arei.gonglei
2014-09-03 13:08 ` Peter Crosthwaite
2014-09-04 0:58 ` Gonglei (Arei)
2014-09-02 12:03 ` [Qemu-devel] [PATCH v5 3/4] qdev: add cleanup logic in device_set_realized() to avoid resource leak arei.gonglei
2014-09-03 13:08 ` Peter Crosthwaite
2014-09-02 12:03 ` [Qemu-devel] [PATCH v5 4/4] pcie: don't assert when hotplug a PCIe device with 'function != 0' arei.gonglei
2014-09-03 13:48 ` Michael S. Tsirkin [this message]
2014-09-04 0:25 ` Gonglei (Arei)
2014-09-02 15:19 ` [Qemu-devel] [PATCH v5 0/4] Refactor device_set_realized to avoid resource leak Michael S. Tsirkin
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20140903134826.GA15485@redhat.com \
--to=mst@redhat.com \
--cc=afaerber@suse.de \
--cc=arei.gonglei@huawei.com \
--cc=imammedo@redhat.com \
--cc=luonengjun@huawei.com \
--cc=pbonzini@redhat.com \
--cc=peter.crosthwaite@xilinx.com \
--cc=peter.huangpeng@huawei.com \
--cc=qemu-devel@nongnu.org \
--cc=weidong.huang@huawei.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).