]> git.proxmox.com Git - mirror_qemu.git/commit - include/hw/qdev-core.h
hw/qdev-core: Fix description of instance_init
authorThomas Huth <thuth@redhat.com>
Mon, 10 Sep 2018 07:46:26 +0000 (09:46 +0200)
committerThomas Huth <thuth@redhat.com>
Tue, 25 Sep 2018 15:26:18 +0000 (17:26 +0200)
commit6038f98904942a84d4a9cb03a2d84a5c1948343b
treea3ec9f63e1be61d44ae24c862f7cf338d9b59e29
parent6871a0d01f16871c67ea46d4264472cce345bb63
hw/qdev-core: Fix description of instance_init

The part of the documentation of DeviceClass that talks about instance_init
is partly wrong: instance_init() functions must not abort or exit, since
the function is also called during introspection of the device already.
So if a device calls exit() during its instance_init() function, QEMU
terminates unexpectedly if somebody tries to just have a look at the
interfaces from the device with "device_add xyz,help" or with the
"device-list-properties" QOM command. This should never happen.

Reviewed-by: Andreas Färber <afaerber@suse.de>
Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Reviewed-by: Markus Armbruster <armbru@redhat.com>
Signed-off-by: Thomas Huth <thuth@redhat.com>
include/hw/qdev-core.h