[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH 43/56] pci-bridge: update mappings for migration/res
From: |
Michael Roth |
Subject: |
[Qemu-devel] [PATCH 43/56] pci-bridge: update mappings for migration/restore |
Date: |
Tue, 13 Aug 2013 10:11:07 -0500 |
From: Don Koch <address@hidden>
Fix for LP#1187529: Devices on PCI bridge stop working when
live-migrated. Update bridge mappings for all PCI bridge
devices in get_pci_config_device().
Signed-off-by: Don Koch <address@hidden>
Signed-off-by: Michael S. Tsirkin <address@hidden>
(cherry picked from commit e78e9ae4a933504d383703870d491615b0261801)
Signed-off-by: Michael Roth <address@hidden>
---
hw/pci/pci.c | 5 +++++
hw/pci/pci_bridge.c | 2 +-
include/hw/pci/pci_bridge.h | 1 +
3 files changed, 7 insertions(+), 1 deletion(-)
diff --git a/hw/pci/pci.c b/hw/pci/pci.c
index d5257ed..26995d7 100644
--- a/hw/pci/pci.c
+++ b/hw/pci/pci.c
@@ -373,6 +373,7 @@ int pci_bus_num(PCIBus *s)
static int get_pci_config_device(QEMUFile *f, void *pv, size_t size)
{
PCIDevice *s = container_of(pv, PCIDevice, config);
+ PCIDeviceClass *pc = PCI_DEVICE_GET_CLASS(s);
uint8_t *config;
int i;
@@ -390,6 +391,10 @@ static int get_pci_config_device(QEMUFile *f, void *pv,
size_t size)
memcpy(s->config, config, size);
pci_update_mappings(s);
+ if (pc->is_bridge) {
+ PCIBridge *b = container_of(s, PCIBridge, dev);
+ pci_bridge_update_mappings(b);
+ }
memory_region_set_enabled(&s->bus_master_enable_region,
pci_get_word(s->config + PCI_COMMAND)
diff --git a/hw/pci/pci_bridge.c b/hw/pci/pci_bridge.c
index 24be6c5..3897bd8 100644
--- a/hw/pci/pci_bridge.c
+++ b/hw/pci/pci_bridge.c
@@ -224,7 +224,7 @@ static void pci_bridge_region_cleanup(PCIBridge *br,
PCIBridgeWindows *w)
g_free(w);
}
-static void pci_bridge_update_mappings(PCIBridge *br)
+void pci_bridge_update_mappings(PCIBridge *br)
{
PCIBridgeWindows *w = br->windows;
diff --git a/include/hw/pci/pci_bridge.h b/include/hw/pci/pci_bridge.h
index 1868f7a..1d8f997 100644
--- a/include/hw/pci/pci_bridge.h
+++ b/include/hw/pci/pci_bridge.h
@@ -37,6 +37,7 @@ PCIBus *pci_bridge_get_sec_bus(PCIBridge *br);
pcibus_t pci_bridge_get_base(const PCIDevice *bridge, uint8_t type);
pcibus_t pci_bridge_get_limit(const PCIDevice *bridge, uint8_t type);
+void pci_bridge_update_mappings(PCIBridge *br);
void pci_bridge_write_config(PCIDevice *d,
uint32_t address, uint32_t val, int len);
void pci_bridge_disable_base_limit(PCIDevice *dev);
--
1.7.9.5
- [Qemu-devel] [PATCH 23/56] block: fix bdrv_flush() ordering in bdrv_close(), (continued)
- [Qemu-devel] [PATCH 23/56] block: fix bdrv_flush() ordering in bdrv_close(), Michael Roth, 2013/08/13
- [Qemu-devel] [PATCH 24/56] target-openrisc: Fix typename in openrisc_cpu_class_by_name(), Michael Roth, 2013/08/13
- [Qemu-devel] [PATCH 25/56] qom: Fix class cast of NULL classes, Michael Roth, 2013/08/13
- [Qemu-devel] [PATCH 29/56] iscsi: fix -ENOSPC in iscsi_create(), Michael Roth, 2013/08/13
- [Qemu-devel] [PATCH 26/56] seccomp: add the asynchronous I/O syscalls to the whitelist, Michael Roth, 2013/08/13
- [Qemu-devel] [PATCH 39/56] xhci: handle USB_RET_IOERROR, Michael Roth, 2013/08/13
- [Qemu-devel] [PATCH 34/56] cpus: Let vm_stop[_force_state]() always flush block devices, Michael Roth, 2013/08/13
- [Qemu-devel] [PATCH 42/56] virtio-console: Use exitfn for virtserialport, too, Michael Roth, 2013/08/13
- [Qemu-devel] [PATCH 40/56] qemu-char: Register ring buffer driver with correct name "ringbuf", Michael Roth, 2013/08/13
- [Qemu-devel] [PATCH 41/56] qapi: Rename ChardevBackend member "memory" to "ringbuf", Michael Roth, 2013/08/13
- [Qemu-devel] [PATCH 43/56] pci-bridge: update mappings for migration/restore,
Michael Roth <=
- [Qemu-devel] [PATCH 45/56] chardev: fix CHR_EVENT_OPENED events for mux chardevs, Michael Roth, 2013/08/13
- [Qemu-devel] [PATCH 44/56] xhci: fix segfault, Michael Roth, 2013/08/13
- [Qemu-devel] [PATCH 48/56] iov: handle EOF in iov_send_recv, Michael Roth, 2013/08/13
- [Qemu-devel] [PATCH 49/56] target-i386: Fix X86CPU error handling, Michael Roth, 2013/08/13
- [Qemu-devel] [PATCH 46/56] seccomp: add arch_prctl() to the syscall whitelist, Michael Roth, 2013/08/13
- [Qemu-devel] [PATCH 47/56] seccomp: add additional asynchronous I/O syscalls, Michael Roth, 2013/08/13
- [Qemu-devel] [PATCH 50/56] ignore SIGPIPE in qemu-img and qemu-io, Michael Roth, 2013/08/13
- [Qemu-devel] [PATCH 51/56] semaphore: fix a hangup problem under load on NetBSD hosts., Michael Roth, 2013/08/13
- [Qemu-devel] [PATCH 52/56] Bugfix for loading multiboot kernels, Michael Roth, 2013/08/13
- [Qemu-devel] [PATCH 53/56] i82801b11: Fix i82801b11 PCI host bridge config space, Michael Roth, 2013/08/13