diff options
author | Tang Chen <tangchen@cn.fujitsu.com> | 2015-01-28 15:45:37 +0800 |
---|---|---|
committer | Michael S. Tsirkin <mst@redhat.com> | 2015-02-26 12:42:18 +0100 |
commit | d9c5c5b8a81433921a75390a9951436424b5c4c5 (patch) | |
tree | 7b5f2f7136483ff12014266080f832469b0a4601 | |
parent | 25f8dd96598042a88fdd970d5531584b589b10e4 (diff) |
acpi, pc: Add hotunplug request cb for pc machine.
Memory and CPU hot unplug are both asynchronous procedures.
They both need unplug request callback to initiate unplug operation.
Add unplug handler to pc machine that will be used by following
CPU and memory unplug patches.
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>
-rw-r--r-- | hw/i386/pc.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/hw/i386/pc.c b/hw/i386/pc.c index 05008cbf6a..ba0b04e963 100644 --- a/hw/i386/pc.c +++ b/hw/i386/pc.c @@ -1679,6 +1679,13 @@ static void pc_machine_device_plug_cb(HotplugHandler *hotplug_dev, } } +static void pc_machine_device_unplug_request_cb(HotplugHandler *hotplug_dev, + DeviceState *dev, Error **errp) +{ + error_setg(errp, "acpi: device unplug request for not supported device" + " type: %s", object_get_typename(OBJECT(dev))); +} + static HotplugHandler *pc_get_hotpug_handler(MachineState *machine, DeviceState *dev) { @@ -1808,6 +1815,7 @@ static void pc_machine_class_init(ObjectClass *oc, void *data) pcmc->get_hotplug_handler = mc->get_hotplug_handler; mc->get_hotplug_handler = pc_get_hotpug_handler; hc->plug = pc_machine_device_plug_cb; + hc->unplug_request = pc_machine_device_unplug_request_cb; } static const TypeInfo pc_machine_info = { |