From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:43428) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1a2GG5-0006X9-8N for qemu-devel@nongnu.org; Fri, 27 Nov 2015 05:28:06 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1a2GG1-0007rE-W9 for qemu-devel@nongnu.org; Fri, 27 Nov 2015 05:28:05 -0500 Received: from [59.151.112.132] (port=49482 helo=heian.cn.fujitsu.com) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1a2GG1-0007iJ-Jz for qemu-devel@nongnu.org; Fri, 27 Nov 2015 05:28:01 -0500 References: <1448358898-2350-1-git-send-email-caoj.fnst@cn.fujitsu.com> <87oaej6772.fsf@blackfin.pond.sub.org> From: Cao jin Message-ID: <5658306A.8050903@cn.fujitsu.com> Date: Fri, 27 Nov 2015 18:28:58 +0800 MIME-Version: 1.0 In-Reply-To: <87oaej6772.fsf@blackfin.pond.sub.org> Content-Type: text/plain; charset="windows-1252"; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH] Give detailed info when pcie downstream port init failed List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Markus Armbruster Cc: qemu-devel@nongnu.org, mst@redhat.com Hi, Markus On 11/24/2015 06:08 PM, Markus Armbruster wrote: > Cao jin writes: > >> detailed error info could show user about how to use it. >> >> Signed-off-by: Cao jin >> --- >> 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. > I looked around in the code, and only find there are monitor & QMP may need be covered. Could give more hints about the "six error paths"? > Please convert the device to realize() instead. For an example, check > out commit 28b07e7. > and this will cover to output to the monitor, right? -- Yours Sincerely, Cao Jin