qdev: set DeviceClass.hotpluggable default in class_init()
PATCH 1/1 qdev: set DeviceClass.hotpluggable default in class_init()
Move setting DeviceClass.hotpluggable default from class_base_init() to device's own class_init().
Reported-by Andreas Färber <[email protected]>
Signed-off-by Igor Mammedov <[email protected]>
--- hw/core/qdev.c | 16 ++++++++-------- 1 files changed, 8 insertions(+), 8 deletions(-)
hw/core/qdev.c +8 -8
@@ -816,14 +816,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)
@@ -869,6 +861,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)
Signature · 1 line
1.7.1
Andreas Färber
AppliedAm 18.02.2014 17:56, schrieb Igor Mammedov:
Quoted 5 lines
Move setting DeviceClass.hotpluggable default from
class_base_init()to device's ownclass_init().Reported-by Andreas Färber <[email protected]>Signed-off-by Igor Mammedov <[email protected]>
Thanks, applied to qom-next:
https://github.com/afaerber/qemu-cpu/commits/qom-next
Andreas
Signature · 2 lines
SUSE LINUX Products GmbH, Maxfeldstr. 5, 90409 Nürnberg, Germany GF: Jeff Hawn, Jennifer Guild, Felix Imendörffer; HRB 16746 AG Nürnberg