[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PULL 09/13] hw/qdev-core: Fix description of instance_init
From: |
Thomas Huth |
Subject: |
[Qemu-devel] [PULL 09/13] hw/qdev-core: Fix description of instance_init |
Date: |
Tue, 25 Sep 2018 18:03:43 +0200 |
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 <address@hidden>
Reviewed-by: Philippe Mathieu-Daudé <address@hidden>
Reviewed-by: Markus Armbruster <address@hidden>
Signed-off-by: Thomas Huth <address@hidden>
---
include/hw/qdev-core.h | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/include/hw/qdev-core.h b/include/hw/qdev-core.h
index f1fd0f8..a24d0dd 100644
--- a/include/hw/qdev-core.h
+++ b/include/hw/qdev-core.h
@@ -51,8 +51,9 @@ struct VMStateDescription;
* Devices are constructed in two stages,
* 1) object instantiation via object_initialize() and
* 2) device realization via #DeviceState:realized property.
- * The former may not fail (it might assert or exit), the latter may return
- * error information to the caller and must be re-entrant.
+ * The former may not fail (and must not abort or exit, since it is called
+ * during device introspection already), and the latter may return error
+ * information to the caller and must be re-entrant.
* Trivial field initializations should go into #TypeInfo.instance_init.
* Operations depending on @props static properties should go into @realize.
* After successful realization, setting static properties will fail.
--
1.8.3.1
- [Qemu-devel] [PULL 00/13] Deprecation, qtests and some trivial doc updates, Thomas Huth, 2018/09/25
- [Qemu-devel] [PULL 01/13] Makefile: Add missing dependency for qemu-deprecated.texi, Thomas Huth, 2018/09/25
- [Qemu-devel] [PULL 04/13] hw/core/machine: Officially deprecate the enforce-config-section parameter, Thomas Huth, 2018/09/25
- [Qemu-devel] [PULL 03/13] net/slirp: Deprecate the [hub_id name] parameter tuple, Thomas Huth, 2018/09/25
- [Qemu-devel] [PULL 05/13] memfd: fix possible usage of the uninitialized file descriptor, Thomas Huth, 2018/09/25
- [Qemu-devel] [PULL 06/13] trivial: Make bios files and source files non-executable, Thomas Huth, 2018/09/25
- [Qemu-devel] [PULL 02/13] net: Deprecate the "name" parameter of -net, Thomas Huth, 2018/09/25
- [Qemu-devel] [PULL 07/13] docs: Fix some typos (most found by codespell), Thomas Huth, 2018/09/25
- [Qemu-devel] [PULL 08/13] qdev: fix a typo in comment, Thomas Huth, 2018/09/25
- [Qemu-devel] [PULL 09/13] hw/qdev-core: Fix description of instance_init,
Thomas Huth <=
- [Qemu-devel] [PULL 12/13] Revert "check: Move endianess test to common", Thomas Huth, 2018/09/25
- [Qemu-devel] [PULL 11/13] Revert "check: Move wdt_ib700 test to common", Thomas Huth, 2018/09/25
- [Qemu-devel] [PULL 10/13] tests/migration: Speed up the test on ppc64, Thomas Huth, 2018/09/25
- [Qemu-devel] [PULL 13/13] Revert "check: Move VMXNET3 test to common", Thomas Huth, 2018/09/25
- Re: [Qemu-devel] [PULL 00/13] Deprecation, qtests and some trivial doc updates, Peter Maydell, 2018/09/27