From: Cao jin <caoj.fnst@cn.fujitsu.com>
To: Markus Armbruster <armbru@redhat.com>
Cc: qemu-devel@nongnu.org, mst@redhat.com
Subject: Re: [Qemu-devel] [PATCH] Give detailed info when pcie downstream port init failed
Date: Tue, 24 Nov 2015 18:42:04 +0800 [thread overview]
Message-ID: <56543EFC.9030508@cn.fujitsu.com> (raw)
In-Reply-To: <87oaej6772.fsf@blackfin.pond.sub.org>
Hi Markus
On 11/24/2015 06:08 PM, Markus Armbruster wrote:
> Cao jin <caoj.fnst@cn.fujitsu.com> writes:
>
>> detailed error info could show user about how to use it.
>>
>> Signed-off-by: Cao jin <caoj.fnst@cn.fujitsu.com>
>> ---
>> hw/pci-bridge/xio3130_downstream.c | 5 +++++
>> 1 file changed, 5 insertions(+)
>>
>> When I learned to use root/upstream/downstream port like this:
>> qemu-system-x86_64 -M q35 -device ioh3420,bus=pcie.0,id=br1 -device x3130-upstream,id=up,bus=br1 -device xio3130-downstream,id=down,bus=up -device e1000,bus=down,id=net0 xxx...
>> downstream port just show me "Device initialization failed", while I don`t really know why at first. So it maybe good to let user know how to use it correctly.
>>
>> diff --git a/hw/pci-bridge/xio3130_downstream.c b/hw/pci-bridge/xio3130_downstream.c
>> index b3a6479..86b7970 100644
>> --- a/hw/pci-bridge/xio3130_downstream.c
>> +++ b/hw/pci-bridge/xio3130_downstream.c
>> @@ -23,6 +23,7 @@
>> #include "hw/pci/msi.h"
>> #include "hw/pci/pcie.h"
>> #include "xio3130_downstream.h"
>> +#include "qemu/error-report.h"
>>
>> #define PCI_DEVICE_ID_TI_XIO3130D 0x8233 /* downstream port */
>> #define XIO3130_REVISION 0x1
>> @@ -89,6 +90,10 @@ static int xio3130_downstream_initfn(PCIDevice *d)
>> pcie_chassis_create(s->chassis);
>> rc = pcie_chassis_add_slot(s);
>> if (rc < 0) {
>> + error_report("Slot number is reduplicate(chassis = %d, slot = %d). "
>> + "Slot #(default 0) is unique within a chassis, chassis #"
>> + "(default 0) is unique in the system. Please change chassis # "
>> + "or slot #.", s->chassis, s->slot);
>> goto err_pcie_cap;
>> }
>> pcie_cap_arifwd_init(d);
>> --
>> 2.1.0
>
> This covers one out of six error paths, and it doesn't work for QMP.
>
> Please convert the device to realize() instead. For an example, check
> out commit 28b07e7.
>
Thanks for your quick review:)OK, will do the investigation right away
--
Yours Sincerely,
Cao Jin
--
This message has been scanned for viruses and
dangerous content by Fujitsu, and is believed to be clean.
next prev parent reply other threads:[~2015-11-24 10:41 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-11-24 9:54 [Qemu-devel] [PATCH] Give detailed info when pcie downstream port init failed Cao jin
2015-11-24 10:08 ` Markus Armbruster
2015-11-24 10:42 ` Cao jin [this message]
2015-11-27 10:28 ` Cao jin
2015-11-27 14:22 ` Markus Armbruster
2015-11-28 7:23 ` Cao jin
2015-11-30 7:58 ` Markus Armbruster
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=56543EFC.9030508@cn.fujitsu.com \
--to=caoj.fnst@cn.fujitsu.com \
--cc=armbru@redhat.com \
--cc=mst@redhat.com \
--cc=qemu-devel@nongnu.org \
/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).