mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-07-31 14:23:53 -06:00
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 <aliguori@us.ibm.com> Signed-off-by: Andreas Färber <afaerber@suse.de> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
This commit is contained in:
parent
2c9ee0291f
commit
7983c8a335
5 changed files with 31 additions and 29 deletions
|
@ -42,7 +42,7 @@ static void set_pointer(Object *obj, Visitor *v, Property *prop,
|
|||
char *str;
|
||||
int ret;
|
||||
|
||||
if (dev->state != DEV_STATE_CREATED) {
|
||||
if (dev->realized) {
|
||||
error_set(errp, QERR_PERMISSION_DENIED);
|
||||
return;
|
||||
}
|
||||
|
@ -254,7 +254,7 @@ static void set_vlan(Object *obj, Visitor *v, void *opaque,
|
|||
int32_t id;
|
||||
NetClientState *hubport;
|
||||
|
||||
if (dev->state != DEV_STATE_CREATED) {
|
||||
if (dev->realized) {
|
||||
error_set(errp, QERR_PERMISSION_DENIED);
|
||||
return;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue