target-s390x: support OC and NC in the EX instruction
[qemu/qmp-unstable.git] / hw / core / hotplug.c
blob4e010745576c28c79abd211718a9dc6514a4d0c6
1 /*
2 * Hotplug handler interface.
4 * Copyright (c) 2014 Red Hat Inc.
6 * Authors:
7 * Igor Mammedov <imammedo@redhat.com>,
9 * This work is licensed under the terms of the GNU GPL, version 2 or later.
10 * See the COPYING file in the top-level directory.
12 #include "hw/hotplug.h"
13 #include "qemu/module.h"
15 void hotplug_handler_plug(HotplugHandler *plug_handler,
16 DeviceState *plugged_dev,
17 Error **errp)
19 HotplugHandlerClass *hdc = HOTPLUG_HANDLER_GET_CLASS(plug_handler);
21 if (hdc->plug) {
22 hdc->plug(plug_handler, plugged_dev, errp);
26 void hotplug_handler_unplug_request(HotplugHandler *plug_handler,
27 DeviceState *plugged_dev,
28 Error **errp)
30 HotplugHandlerClass *hdc = HOTPLUG_HANDLER_GET_CLASS(plug_handler);
32 if (hdc->unplug_request) {
33 hdc->unplug_request(plug_handler, plugged_dev, errp);
37 void hotplug_handler_unplug(HotplugHandler *plug_handler,
38 DeviceState *plugged_dev,
39 Error **errp)
41 HotplugHandlerClass *hdc = HOTPLUG_HANDLER_GET_CLASS(plug_handler);
43 if (hdc->unplug) {
44 hdc->unplug(plug_handler, plugged_dev, errp);
48 static const TypeInfo hotplug_handler_info = {
49 .name = TYPE_HOTPLUG_HANDLER,
50 .parent = TYPE_INTERFACE,
51 .class_size = sizeof(HotplugHandlerClass),
54 static void hotplug_handler_register_types(void)
56 type_register_static(&hotplug_handler_info);
59 type_init(hotplug_handler_register_types)