Blame SOURCES/kvm-xio3130_downstream-Report-error-if-pcie_chassis_add_.patch

9bac43
From f6968c5837e2201172968a49dcd7cd10e1e5a337 Mon Sep 17 00:00:00 2001
9bac43
From: Eduardo Habkost <ehabkost@redhat.com>
9bac43
Date: Fri, 20 Oct 2017 18:29:11 +0200
9bac43
Subject: [PATCH 06/19] xio3130_downstream: Report error if
9bac43
 pcie_chassis_add_slot() failed
9bac43
9bac43
RH-Author: Eduardo Habkost <ehabkost@redhat.com>
9bac43
Message-id: <20171020182917.10771-2-ehabkost@redhat.com>
9bac43
Patchwork-id: 77421
9bac43
O-Subject: [RHV7.5 qemu-kvm-rhev PATCH v2 1/7] xio3130_downstream: Report error if pcie_chassis_add_slot() failed
9bac43
Bugzilla: 1390348
9bac43
RH-Acked-by: Marcel Apfelbaum <marcel@redhat.com>
9bac43
RH-Acked-by: Michael S. Tsirkin <mst@redhat.com>
9bac43
RH-Acked-by: Laurent Vivier <lvivier@redhat.com>
9bac43
9bac43
On commit f8cd1b02 ("pci: Convert to realize"), no error_set*()
9bac43
call was added for the pcie_chassis_add_slot() error case.
9bac43
pcie_chassis_add_slot() errors get ignored, making QEMU crash
9bac43
later.  e.g.:
9bac43
9bac43
  $ qemu-system-x86_64 -device ioh3420 -device xio3130-downstream
9bac43
  qemu-system-x86_64: memory.c:2166: memory_region_del_subregion: Assertion `subregion->container == mr' failed.
9bac43
  Aborted (core dumped)
9bac43
9bac43
Fix it by reporting the error using error_setg().
9bac43
9bac43
Fixes: f8cd1b0201c41d88bb97dcafb80348a0e88d8805
9bac43
Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
9bac43
Reviewed-by: Marcel Apfelbaum <marcel@redhat.com>
9bac43
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
9bac43
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
9bac43
(cherry picked from commit 8b3d26342c4aa171e759e6392fe3b742759d4963)
9bac43
Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
9bac43
Signed-off-by: Miroslav Rezanina <mrezanin@redhat.com>
9bac43
---
9bac43
 hw/pci-bridge/xio3130_downstream.c | 1 +
9bac43
 1 file changed, 1 insertion(+)
9bac43
9bac43
diff --git a/hw/pci-bridge/xio3130_downstream.c b/hw/pci-bridge/xio3130_downstream.c
9bac43
index e706f36..5a882b0 100644
9bac43
--- a/hw/pci-bridge/xio3130_downstream.c
9bac43
+++ b/hw/pci-bridge/xio3130_downstream.c
9bac43
@@ -94,6 +94,7 @@ static void xio3130_downstream_realize(PCIDevice *d, Error **errp)
9bac43
     pcie_chassis_create(s->chassis);
9bac43
     rc = pcie_chassis_add_slot(s);
9bac43
     if (rc < 0) {
9bac43
+        error_setg(errp, "Can't add chassis slot, error %d", rc);
9bac43
         goto err_pcie_cap;
9bac43
     }
9bac43
 
9bac43
-- 
9bac43
1.8.3.1
9bac43