render / rpms / qemu

Forked from rpms/qemu 10 months ago
Clone

Blame 0001-pci-do-not-export-pci_bus_reset.patch

bacd9b
From 4f9f83c8b0a26a24ab2963e57a375b0ba99638f1 Mon Sep 17 00:00:00 2001
9e0a86
From: Paolo Bonzini <pbonzini@redhat.com>
9e0a86
Date: Thu, 2 May 2013 11:38:37 +0200
9e0a86
Subject: [PATCH] pci: do not export pci_bus_reset
9e0a86
9e0a86
qbus_reset_all can be used instead.  There is no semantic change
9e0a86
because pcibus_reset returns 1 and takes care of the device
9e0a86
tree traversal.
9e0a86
9e0a86
This will be necessary once the traversal is done always in
9e0a86
qbus_reset_all *before* invoking pcibus_reset itself.
9e0a86
9e0a86
Tested-by: Claudio Bley <cbley@av-test.de>
9e0a86
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
9e0a86
---
9e0a86
 hw/pci/pci.c         | 8 ++------
9e0a86
 hw/pci/pci_bridge.c  | 2 +-
9e0a86
 include/hw/pci/pci.h | 1 -
9e0a86
 3 files changed, 3 insertions(+), 8 deletions(-)
9e0a86
9e0a86
diff --git a/hw/pci/pci.c b/hw/pci/pci.c
bacd9b
index 49eca95..504ed9d 100644
9e0a86
--- a/hw/pci/pci.c
9e0a86
+++ b/hw/pci/pci.c
bacd9b
@@ -212,8 +212,9 @@ void pci_device_reset(PCIDevice *dev)
9e0a86
  * Trigger pci bus reset under a given bus.
9e0a86
  * To be called on RST# assert.
9e0a86
  */
9e0a86
-void pci_bus_reset(PCIBus *bus)
9e0a86
+static int pcibus_reset(BusState *qbus)
9e0a86
 {
9e0a86
+    PCIBus *bus = DO_UPCAST(PCIBus, qbus, qbus);
9e0a86
     int i;
9e0a86
 
9e0a86
     for (i = 0; i < bus->nirq; i++) {
bacd9b
@@ -224,11 +225,6 @@ void pci_bus_reset(PCIBus *bus)
9e0a86
             pci_device_reset(bus->devices[i]);
9e0a86
         }
9e0a86
     }
9e0a86
-}
9e0a86
-
9e0a86
-static int pcibus_reset(BusState *qbus)
9e0a86
-{
9e0a86
-    pci_bus_reset(DO_UPCAST(PCIBus, qbus, qbus));
9e0a86
 
9e0a86
     /* topology traverse is done by pci_bus_reset().
9e0a86
        Tell qbus/qdev walker not to traverse the tree */
9e0a86
diff --git a/hw/pci/pci_bridge.c b/hw/pci/pci_bridge.c
45bdef
index 290abab..41d8755 100644
9e0a86
--- a/hw/pci/pci_bridge.c
9e0a86
+++ b/hw/pci/pci_bridge.c
9e0a86
@@ -268,7 +268,7 @@ void pci_bridge_write_config(PCIDevice *d,
9e0a86
     newctl = pci_get_word(d->config + PCI_BRIDGE_CONTROL);
9e0a86
     if (~oldctl & newctl & PCI_BRIDGE_CTL_BUS_RESET) {
9e0a86
         /* Trigger hot reset on 0->1 transition. */
9e0a86
-        pci_bus_reset(&s->sec_bus);
9e0a86
+        qbus_reset_all(&s->sec_bus.qbus);
9e0a86
     }
9e0a86
 }
9e0a86
 
9e0a86
diff --git a/include/hw/pci/pci.h b/include/hw/pci/pci.h
45bdef
index b783e68..754b82d 100644
9e0a86
--- a/include/hw/pci/pci.h
9e0a86
+++ b/include/hw/pci/pci.h
45bdef
@@ -373,7 +373,6 @@ void pci_bus_fire_intx_routing_notifier(PCIBus *bus);
9e0a86
 void pci_device_set_intx_routing_notifier(PCIDevice *dev,
9e0a86
                                           PCIINTxRoutingNotifier notifier);
9e0a86
 void pci_device_reset(PCIDevice *dev);
9e0a86
-void pci_bus_reset(PCIBus *bus);
9e0a86
 
9e0a86
 PCIDevice *pci_nic_init(NICInfo *nd, PCIBus *rootbus,
9e0a86
                         const char *default_model,