summaryrefslogtreecommitdiff
path: root/hw/core
diff options
context:
space:
mode:
authorIgor Mammedov <imammedo@redhat.com>2014-02-18 17:56:53 +0100
committerAndreas Färber <afaerber@suse.de>2014-03-12 20:13:02 +0100
commit267a3264cdaf0ca945ffc7a60c019ad9f89be8d8 (patch)
treeba679d44559d7622c2e86d94fec1b39aa6070076 /hw/core
parent2b81b35f8f18d6874d1a0605ac5e40028966051b (diff)
downloadqemu-267a3264cdaf0ca945ffc7a60c019ad9f89be8d8.tar.gz
qdev: Set DeviceClass::hotpluggable default in class_init()
Move setting DeviceClass::hotpluggable default from device's class_base_init() to device's class_init(). Reported-by: Andreas Färber <afaerber@suse.de> Signed-off-by: Igor Mammedov <imammedo@redhat.com> Signed-off-by: Andreas Färber <afaerber@suse.de>
Diffstat (limited to 'hw/core')
-rw-r--r--hw/core/qdev.c16
1 files changed, 8 insertions, 8 deletions
diff --git a/hw/core/qdev.c b/hw/core/qdev.c
index 53778938e6..71b70454eb 100644
--- a/hw/core/qdev.c
+++ b/hw/core/qdev.c
@@ -793,14 +793,6 @@ static void device_class_base_init(ObjectClass *class, void *data)
* so do not propagate them to the subclasses.
*/
klass->props = NULL;
-
- /* by default all devices were considered as hotpluggable,
- * so with intent to check it in generic qdev_unplug() /
- * device_set_realized() functions make every device
- * hotpluggable. Devices that shouldn't be hotpluggable,
- * should override it in their class_init()
- */
- klass->hotpluggable = true;
}
static void device_unparent(Object *obj)
@@ -846,6 +838,14 @@ static void device_class_init(ObjectClass *class, void *data)
class->unparent = device_unparent;
dc->realize = device_realize;
dc->unrealize = device_unrealize;
+
+ /* by default all devices were considered as hotpluggable,
+ * so with intent to check it in generic qdev_unplug() /
+ * device_set_realized() functions make every device
+ * hotpluggable. Devices that shouldn't be hotpluggable,
+ * should override it in their class_init()
+ */
+ dc->hotpluggable = true;
}
void device_reset(DeviceState *dev)