[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH 31/32] pci: unregister vmstate_pcibus on unplug
From: |
Michael Roth |
Subject: |
[Qemu-devel] [PATCH 31/32] pci: unregister vmstate_pcibus on unplug |
Date: |
Wed, 4 Dec 2013 08:34:38 -0600 |
From: Bandan Das <address@hidden>
PCIBus registers a vmstate during init. Unregister it upon
removal/unplug.
Signed-off-by: Bandan Das <address@hidden>
Cc: address@hidden
Reviewed-by: Andreas Färber <address@hidden>
Signed-off-by: Michael S. Tsirkin <address@hidden>
(cherry picked from commit 5c397242d5d53c1adecce31817bb439383cf8228)
Signed-off-by: Michael Roth <address@hidden>
---
hw/pci/pci.c | 8 ++++++++
1 file changed, 8 insertions(+)
diff --git a/hw/pci/pci.c b/hw/pci/pci.c
index 4c004f5..dc5b788 100644
--- a/hw/pci/pci.c
+++ b/hw/pci/pci.c
@@ -47,6 +47,7 @@ static void pcibus_dev_print(Monitor *mon, DeviceState *dev,
int indent);
static char *pcibus_get_dev_path(DeviceState *dev);
static char *pcibus_get_fw_dev_path(DeviceState *dev);
static int pcibus_reset(BusState *qbus);
+static void pci_bus_finalize(Object *obj);
static Property pci_props[] = {
DEFINE_PROP_PCI_DEVFN("addr", PCIDevice, devfn, -1),
@@ -73,6 +74,7 @@ static const TypeInfo pci_bus_info = {
.name = TYPE_PCI_BUS,
.parent = TYPE_BUS,
.instance_size = sizeof(PCIBus),
+ .instance_finalize = pci_bus_finalize,
.class_init = pci_bus_class_init,
};
@@ -375,6 +377,12 @@ int pci_bus_num(PCIBus *s)
return s->parent_dev->config[PCI_SECONDARY_BUS];
}
+static void pci_bus_finalize(Object *obj)
+{
+ PCIBus *bus = PCI_BUS(obj);
+ vmstate_unregister(NULL, &vmstate_pcibus, bus);
+}
+
static int get_pci_config_device(QEMUFile *f, void *pv, size_t size)
{
PCIDevice *s = container_of(pv, PCIDevice, config);
--
1.7.9.5
- [Qemu-devel] [PATCH 05/32] tests: Update .gitignore for test-int128 and test-bitops, (continued)
- [Qemu-devel] [PATCH 05/32] tests: Update .gitignore for test-int128 and test-bitops, Michael Roth, 2013/12/04
- [Qemu-devel] [PATCH 03/32] char: remove watch callback on chardev detach from frontend, Michael Roth, 2013/12/04
- [Qemu-devel] [PATCH 02/32] char: use common function to disable callbacks on chardev close, Michael Roth, 2013/12/04
- [Qemu-devel] [PATCH 07/32] bitops: Add rotate functions (rol8, ror8, ...), Michael Roth, 2013/12/04
- [Qemu-devel] [PATCH 06/32] tci: Add implementation of rotl_i64, rotr_i64, Michael Roth, 2013/12/04
- [Qemu-devel] [PATCH 09/32] qemu-char: Fix potential out of bounds access to local arrays, Michael Roth, 2013/12/04
- [Qemu-devel] [PATCH 10/32] xen_disk: mark ioreq as mapped before unmapping in error case, Michael Roth, 2013/12/04
- [Qemu-devel] [PATCH 08/32] misc: Use new rotate functions, Michael Roth, 2013/12/04
- [Qemu-devel] [PATCH 12/32] audio: honor QEMU_AUDIO_TIMER_PERIOD instead of waking up every *nano* second, Michael Roth, 2013/12/04
- [Qemu-devel] [PATCH 30/32] qdev-monitor: Unref device when device_add fails, Michael Roth, 2013/12/04
- [Qemu-devel] [PATCH 31/32] pci: unregister vmstate_pcibus on unplug,
Michael Roth <=
- [Qemu-devel] [PATCH 32/32] rng-egd: offset the point when repeatedly read from the buffer, Michael Roth, 2013/12/04
- [Qemu-devel] [PATCH 29/32] qdev-monitor: Fix crash when device_add is called with abstract driver, Michael Roth, 2013/12/04
- [Qemu-devel] [PATCH 26/32] vfio-pci: Fix multifunction=on, Michael Roth, 2013/12/04
- [Qemu-devel] [PATCH 28/32] qom: Fix memory leak in object_property_set_link(), Michael Roth, 2013/12/04
- [Qemu-devel] [PATCH 13/32] monitor: eliminate monitor_event_state_lock, Michael Roth, 2013/12/04
- [Qemu-devel] [PATCH 27/32] virtio-net: fix the memory leak in rxfilter_notify(), Michael Roth, 2013/12/04
- [Qemu-devel] [PATCH 21/32] virtio-net: only delete bh that existed, Michael Roth, 2013/12/04
- [Qemu-devel] [PATCH 24/32] qcow2: count_contiguous_clusters and compression, Michael Roth, 2013/12/04
- [Qemu-devel] [PATCH 25/32] qcow2: fix possible corruption when reading multiple clusters, Michael Roth, 2013/12/04
- [Qemu-devel] [PATCH 20/32] linux-user: Fix stat64 syscall for SPARC64, Michael Roth, 2013/12/04