From: "Michael S. Tsirkin" <mst@redhat.com>
To: qemu-devel@nongnu.org
Cc: "Bandan Das" <bsd@redhat.com>,
qemu-stable@nongnu.org,
=?UTF-8?q?Andreas=20F=C3=A4rber?= <afaerber@suse.de>
Subject: [Qemu-devel] [PULL for-1.7 2/5] pci: unregister vmstate_pcibus on unplug
Date: Thu, 21 Nov 2013 17:14:28 +0200 [thread overview]
Message-ID: <1385046834-11929-3-git-send-email-mst@redhat.com> (raw)
In-Reply-To: <1385046834-11929-1-git-send-email-mst@redhat.com>
From: Bandan Das <bsd@redhat.com>
PCIBus registers a vmstate during init. Unregister it upon
removal/unplug.
Signed-off-by: Bandan Das <bsd@redhat.com>
Cc: qemu-stable@nongnu.org
Reviewed-by: Andreas Färber <afaerber@suse.de>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
---
hw/pci/pci.c | 8 ++++++++
1 file changed, 8 insertions(+)
diff --git a/hw/pci/pci.c b/hw/pci/pci.c
index ed32059..49eca95 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);
--
MST
next prev parent reply other threads:[~2013-11-21 15:11 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-11-21 15:14 [Qemu-devel] [PULL for-1.7 0/5] pc very last minute fixes for 1.7 Michael S. Tsirkin
2013-11-21 15:14 ` [Qemu-devel] [PULL for-1.7 1/5] s390x: fix flat file load on 32 bit systems Michael S. Tsirkin
2013-11-21 15:14 ` Michael S. Tsirkin [this message]
2013-11-21 15:14 ` [Qemu-devel] [PULL for-1.7 3/5] acpi-build: fix build on glib < 2.22 Michael S. Tsirkin
2013-11-21 15:14 ` [Qemu-devel] [PULL for-1.7 4/5] acpi-build: fix build on glib < 2.14 Michael S. Tsirkin
2013-11-21 15:14 ` [Qemu-devel] [PULL for-1.7 5/5] Revert "e1000/rtl8139: update HMP NIC when every bit is written" Michael S. Tsirkin
2013-11-23 1:52 ` Amos Kong
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1385046834-11929-3-git-send-email-mst@redhat.com \
--to=mst@redhat.com \
--cc=afaerber@suse.de \
--cc=bsd@redhat.com \
--cc=qemu-devel@nongnu.org \
--cc=qemu-stable@nongnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).