diff options
author | Igor Mammedov | 2014-09-26 11:28:20 +0200 |
---|---|---|
committer | Andreas Färber | 2014-10-15 05:03:13 +0200 |
commit | 181a2c63236966b3c80eef131bac33a355a492da (patch) | |
tree | d56e099a5191945d0185d1f8f1df3db4779b1b54 /hw/core/hotplug.c | |
parent | qdev: HotplugHandler: Rename unplug callback to unplug_request (diff) | |
download | qemu-181a2c63236966b3c80eef131bac33a355a492da.tar.gz qemu-181a2c63236966b3c80eef131bac33a355a492da.tar.xz qemu-181a2c63236966b3c80eef131bac33a355a492da.zip |
qdev: HotplugHandler: Provide unplug callback
It is to be called for actual device removal and
will allow to separate request and removal handling
phases of x86-CPU devices and also it's a handler
to be called for synchronously removable devices.
Signed-off-by: Igor Mammedov <imammedo@redhat.com>
Reviewed-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Andreas Färber <afaerber@suse.de>
Diffstat (limited to 'hw/core/hotplug.c')
-rw-r--r-- | hw/core/hotplug.c | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/hw/core/hotplug.c b/hw/core/hotplug.c index 2ec4736593..4e01074557 100644 --- a/hw/core/hotplug.c +++ b/hw/core/hotplug.c @@ -34,6 +34,17 @@ void hotplug_handler_unplug_request(HotplugHandler *plug_handler, } } +void hotplug_handler_unplug(HotplugHandler *plug_handler, + DeviceState *plugged_dev, + Error **errp) +{ + HotplugHandlerClass *hdc = HOTPLUG_HANDLER_GET_CLASS(plug_handler); + + if (hdc->unplug) { + hdc->unplug(plug_handler, plugged_dev, errp); + } +} + static const TypeInfo hotplug_handler_info = { .name = TYPE_HOTPLUG_HANDLER, .parent = TYPE_INTERFACE, |