[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PULL v2 13/34] hw/pci-bridge: fix QEMU crash because of pc
From: |
Michael S. Tsirkin |
Subject: |
[Qemu-devel] [PULL v2 13/34] hw/pci-bridge: fix QEMU crash because of pcie-root-port |
Date: |
Tue, 16 Jan 2018 19:49:55 +0200 |
From: Marcel Apfelbaum <address@hidden>
If we try to use more pcie_root_ports then available slots
and an IO hint is passed to the port, QEMU crashes because
we try to init the "IO hint" capability even if the device
is not created.
Fix it by checking for error before adding the capability,
so QEMU can fail gracefully.
Signed-off-by: Marcel Apfelbaum <address@hidden>
Reviewed-by: Michael S. Tsirkin <address@hidden>
Signed-off-by: Michael S. Tsirkin <address@hidden>
---
hw/pci-bridge/gen_pcie_root_port.c | 7 ++++++-
1 file changed, 6 insertions(+), 1 deletion(-)
diff --git a/hw/pci-bridge/gen_pcie_root_port.c
b/hw/pci-bridge/gen_pcie_root_port.c
index ad4e6aa..0e2f2e8 100644
--- a/hw/pci-bridge/gen_pcie_root_port.c
+++ b/hw/pci-bridge/gen_pcie_root_port.c
@@ -74,8 +74,13 @@ static void gen_rp_realize(DeviceState *dev, Error **errp)
PCIDevice *d = PCI_DEVICE(dev);
GenPCIERootPort *grp = GEN_PCIE_ROOT_PORT(d);
PCIERootPortClass *rpc = PCIE_ROOT_PORT_GET_CLASS(d);
+ Error *local_err = NULL;
- rpc->parent_realize(dev, errp);
+ rpc->parent_realize(dev, &local_err);
+ if (local_err) {
+ error_propagate(errp, local_err);
+ return;
+ }
int rc = pci_bridge_qemu_reserve_cap_init(d, 0, grp->bus_reserve,
grp->io_reserve, grp->mem_reserve, grp->pref32_reserve,
--
MST
- [Qemu-devel] [PULL v2 04/34] contrib/libvhost-user: enable virtio config space messages, (continued)
- [Qemu-devel] [PULL v2 04/34] contrib/libvhost-user: enable virtio config space messages, Michael S. Tsirkin, 2018/01/16
- [Qemu-devel] [PULL v2 06/34] qemu: add a cleanup callback function to EventNotifier, Michael S. Tsirkin, 2018/01/16
- [Qemu-devel] [PULL v2 07/34] virtio: postpone the execution of event_notifier_cleanup function, Michael S. Tsirkin, 2018/01/16
- [Qemu-devel] [PULL v2 08/34] virtio: improve virtio devices initialization time, Michael S. Tsirkin, 2018/01/16
- [Qemu-devel] [PULL v2 05/34] contrib/vhost-user-blk: introduce a vhost-user-blk sample application, Michael S. Tsirkin, 2018/01/16
- [Qemu-devel] [PULL v2 10/34] vhost-user: fix multiple queue specification, Michael S. Tsirkin, 2018/01/16
- [Qemu-devel] [PULL v2 09/34] pci/shpc: Move function to generic header file, Michael S. Tsirkin, 2018/01/16
- [Qemu-devel] [PULL v2 11/34] intel-iommu: Redefine macros to enable supporting 48 bit address width, Michael S. Tsirkin, 2018/01/16
- [Qemu-devel] [PULL v2 12/34] intel-iommu: Extend address width to 48 bits, Michael S. Tsirkin, 2018/01/16
- [Qemu-devel] [PULL v2 14/34] ACPI/unit-test: Add a testcase for RAM allocation in numa node, Michael S. Tsirkin, 2018/01/16
- [Qemu-devel] [PULL v2 13/34] hw/pci-bridge: fix QEMU crash because of pcie-root-port,
Michael S. Tsirkin <=
- [Qemu-devel] [PULL v2 15/34] hw/acpi-build: Make next_base easy to follow, Michael S. Tsirkin, 2018/01/16
- [Qemu-devel] [PULL v2 16/34] vhost-user-test: fix features mask, Michael S. Tsirkin, 2018/01/16
- [Qemu-devel] [PULL v2 17/34] vhost-user-test: extract read-guest-mem test from main loop, Michael S. Tsirkin, 2018/01/16
- [Qemu-devel] [PULL v2 18/34] vhost-user-test: setup virtqueues in all tests, Michael S. Tsirkin, 2018/01/16
- [Qemu-devel] [PULL v2 19/34] vhost-user-test: make features mask an init_virtio_dev() argument, Michael S. Tsirkin, 2018/01/16
- [Qemu-devel] [PULL v2 20/34] vhost-user-test: use init_virtio_dev in multiqueue test, Michael S. Tsirkin, 2018/01/16
- [Qemu-devel] [PULL v2 22/34] vhost: Simplify ring verification checks, Michael S. Tsirkin, 2018/01/16
- [Qemu-devel] [PULL v2 21/34] vhost: Build temporary section list and deref after commit, Michael S. Tsirkin, 2018/01/16
- [Qemu-devel] [PULL v2 23/34] vhost: Merge sections added to temporary list, Michael S. Tsirkin, 2018/01/16
- [Qemu-devel] [PULL v2 24/34] x86_iommu: Move machine check to x86_iommu_realize(), Michael S. Tsirkin, 2018/01/16