diff options
| author | Amos Kong | 2014-03-03 08:57:55 +0100 |
|---|---|---|
| committer | Andreas Färber | 2014-03-12 20:13:02 +0100 |
| commit | 7b0309490cb108d881a0c66d6b350b4db7b3b4ac (patch) | |
| tree | e8ef8ce540d3fa37372e435e82ac31970e95a969 /include/exec/exec-all.h | |
| parent | qdev: Set DeviceClass::hotpluggable default in class_init() (diff) | |
| download | qemu-7b0309490cb108d881a0c66d6b350b4db7b3b4ac.tar.gz qemu-7b0309490cb108d881a0c66d6b350b4db7b3b4ac.tar.xz qemu-7b0309490cb108d881a0c66d6b350b4db7b3b4ac.zip | |
qdev-monitor: Set properties after parent is assigned in device_add
Test steps:
(qemu) device_add e1000,addr=adsf
Property 'e1000.addr' doesn't take value 'adsf'
(qemu) info qtree
Then qemu crashed.
Currently we set a link to the new device from its parent bus, but the
device hasn't been added to QOM tree yet. When it fails to set properties,
object_unparent() can't clean up the device.
Delay setting of device properties until the device has been added to
the QOM composition tree. This way, when setting a property fails,
object_unparent() can clean up the device properly.
Signed-off-by: Amos Kong <akong@redhat.com>
Reviewed-by: Igor Mammedov <imammedo@redhat.com>
Signed-off-by: Andreas Färber <afaerber@suse.de>
Diffstat (limited to 'include/exec/exec-all.h')
0 files changed, 0 insertions, 0 deletions
