summaryrefslogtreecommitdiff
path: root/hw
diff options
context:
space:
mode:
authorTang Chen <tangchen@cn.fujitsu.com>2015-01-28 15:45:41 +0800
committerMichael S. Tsirkin <mst@redhat.com>2015-02-26 12:42:19 +0100
commitc0e57a6022fdb2b00e7946bbfa2ad1f9515527cd (patch)
treeaeded67ec0b018fd838002aba0bc387d40a71b24 /hw
parent91a734a6fa0fcd03a7ffc32a7b45a3c2735d82be (diff)
downloadqemu-c0e57a6022fdb2b00e7946bbfa2ad1f9515527cd.tar.gz
qemu-c0e57a6022fdb2b00e7946bbfa2ad1f9515527cd.tar.bz2
qemu-c0e57a6022fdb2b00e7946bbfa2ad1f9515527cd.zip
acpi, piix4: Add unplug cb for piix4.
Memory and CPU hot unplug are both asynchronous procedures. When the unplug operation happens, unplug request cb is called first. And when guest OS finished handling unplug, unplug cb will be called to do the real removal of device. This patch adds hotunplug cb to piix4, which memory and CPU hot unplug will use it. Reviewed-by: Igor Mammedov <imammedo@redhat.com> Signed-off-by: Tang Chen <tangchen@cn.fujitsu.com> Signed-off-by: Zhu Guihua <zhugh.fnst@cn.fujitsu.com> Reviewed-by: Michael S. Tsirkin <mst@redhat.com> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Diffstat (limited to 'hw')
-rw-r--r--hw/acpi/piix4.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/hw/acpi/piix4.c b/hw/acpi/piix4.c
index 017510b791..766f1b8552 100644
--- a/hw/acpi/piix4.c
+++ b/hw/acpi/piix4.c
@@ -370,6 +370,13 @@ static void piix4_device_unplug_request_cb(HotplugHandler *hotplug_dev,
}
}
+static void piix4_device_unplug_cb(HotplugHandler *hotplug_dev,
+ DeviceState *dev, Error **errp)
+{
+ error_setg(errp, "acpi: device unplug for not supported device"
+ " type: %s", object_get_typename(OBJECT(dev)));
+}
+
static void piix4_update_bus_hotplug(PCIBus *pci_bus, void *opaque)
{
PIIX4PMState *s = opaque;
@@ -609,6 +616,7 @@ static void piix4_pm_class_init(ObjectClass *klass, void *data)
dc->hotpluggable = false;
hc->plug = piix4_device_plug_cb;
hc->unplug_request = piix4_device_unplug_request_cb;
+ hc->unplug = piix4_device_unplug_cb;
adevc->ospm_status = piix4_ospm_status;
}