mirror of
https://github.com/mii443/qemu.git
synced 2025-12-16 17:18:49 +00: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:
committed by
Anthony Liguori
parent
2c9ee0291f
commit
7983c8a335
@@ -8,11 +8,6 @@
|
||||
#include "hw/irq.h"
|
||||
#include "qapi/error.h"
|
||||
|
||||
enum DevState {
|
||||
DEV_STATE_CREATED = 1,
|
||||
DEV_STATE_INITIALIZED,
|
||||
};
|
||||
|
||||
enum {
|
||||
DEV_NVECTORS_UNSPECIFIED = -1,
|
||||
};
|
||||
@@ -49,13 +44,20 @@ typedef struct DeviceClass {
|
||||
const char *bus_type;
|
||||
} DeviceClass;
|
||||
|
||||
/* This structure should not be accessed directly. We declare it here
|
||||
so that it can be embedded in individual device state structures. */
|
||||
/**
|
||||
* DeviceState:
|
||||
* @realized: Indicates whether the device has been fully constructed.
|
||||
*
|
||||
* This structure should not be accessed directly. We declare it here
|
||||
* so that it can be embedded in individual device state structures.
|
||||
*/
|
||||
struct DeviceState {
|
||||
/*< private >*/
|
||||
Object parent_obj;
|
||||
/*< public >*/
|
||||
|
||||
const char *id;
|
||||
enum DevState state;
|
||||
bool realized;
|
||||
QemuOpts *opts;
|
||||
int hotplugged;
|
||||
BusState *parent_bus;
|
||||
|
||||
Reference in New Issue
Block a user