diff options
author | Igor Mammedov <imammedo@redhat.com> | 2014-09-26 09:28:20 +0000 |
---|---|---|
committer | Andreas Färber <afaerber@suse.de> | 2014-10-15 05:03:13 +0200 |
commit | 181a2c63236966b3c80eef131bac33a355a492da (patch) | |
tree | d56e099a5191945d0185d1f8f1df3db4779b1b54 /include/hw | |
parent | 14d5a28fb6bb8ac6505ad1faca2690df56fef326 (diff) |
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 'include/hw')
-rw-r--r-- | include/hw/hotplug.h | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/include/hw/hotplug.h b/include/hw/hotplug.h index e397d0819a..050d2f0530 100644 --- a/include/hw/hotplug.h +++ b/include/hw/hotplug.h @@ -50,6 +50,9 @@ typedef void (*hotplug_fn)(HotplugHandler *plug_handler, * @unplug_request: unplug request callback. * Used as a means to initiate device unplug for devices that * require asynchronous unplug handling. + * @unplug: unplug callback. + * Used for device removal with devices that implement + * asynchronous and synchronous (suprise) removal. */ typedef struct HotplugHandlerClass { /* <private> */ @@ -58,6 +61,7 @@ typedef struct HotplugHandlerClass { /* <public> */ hotplug_fn plug; hotplug_fn unplug_request; + hotplug_fn unplug; } HotplugHandlerClass; /** @@ -77,4 +81,12 @@ void hotplug_handler_plug(HotplugHandler *plug_handler, void hotplug_handler_unplug_request(HotplugHandler *plug_handler, DeviceState *plugged_dev, Error **errp); +/** + * hotplug_handler_unplug: + * + * Calls #HotplugHandlerClass.unplug callback of @plug_handler. + */ +void hotplug_handler_unplug(HotplugHandler *plug_handler, + DeviceState *plugged_dev, + Error **errp); #endif |