qdev: Fold state enum into bool realized
Whether the device was initialized or not is QOM-level information and
currently unused. Drop it from device. This leaves the boolean state of
whether or not DeviceClass::init was called or not, a.k.a. "realized".
Suggested-by: Anthony Liguori <[email protected]>
Signed-off-by: Andreas Färber <[email protected]>
Signed-off-by: Anthony Liguori <[email protected]>
diff --git a/hw/qdev-addr.c b/hw/qdev-addr.c
index 3bfe101..b4388f6 100644
--- a/hw/qdev-addr.c
+++ b/hw/qdev-addr.c
@@ -40,7 +40,7 @@
Error *local_err = NULL;
int64_t value;
- if (dev->state != DEV_STATE_CREATED) {
+ if (dev->realized) {
error_set(errp, QERR_PERMISSION_DENIED);
return;
}