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>
This commit is contained in:
Tang Chen 2015-01-28 15:45:37 +08:00 committed by Michael S. Tsirkin
parent 25f8dd9659
commit d9c5c5b8a8

View File

@ -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 = {