diff options
author | Andreas Färber <afaerber@suse.de> | 2013-01-09 03:58:10 +0100 |
---|---|---|
committer | Anthony Liguori <aliguori@us.ibm.com> | 2013-01-15 18:26:30 -0600 |
commit | 7983c8a335dd09fec49f99a44d4404aa87828c0a (patch) | |
tree | c69919e4bfc2de020b0d9b12df47bfd8527aa50d /hw/qdev-properties.c | |
parent | 2c9ee0291f8ca7e18f8e96a34e8f4be7867219d2 (diff) | |
download | qemu-7983c8a335dd09fec49f99a44d4404aa87828c0a.zip qemu-7983c8a335dd09fec49f99a44d4404aa87828c0a.tar.gz qemu-7983c8a335dd09fec49f99a44d4404aa87828c0a.tar.bz2 |
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>
Diffstat (limited to 'hw/qdev-properties.c')
-rw-r--r-- | hw/qdev-properties.c | 24 |
1 files changed, 12 insertions, 12 deletions
diff --git a/hw/qdev-properties.c b/hw/qdev-properties.c index f724357..a8a31f5 100644 --- a/hw/qdev-properties.c +++ b/hw/qdev-properties.c @@ -32,7 +32,7 @@ static void set_enum(Object *obj, Visitor *v, void *opaque, Property *prop = opaque; int *ptr = qdev_get_prop_ptr(dev, prop); - if (dev->state != DEV_STATE_CREATED) { + if (dev->realized) { error_set(errp, QERR_PERMISSION_DENIED); return; } @@ -85,7 +85,7 @@ static void set_bit(Object *obj, Visitor *v, void *opaque, Error *local_err = NULL; bool value; - if (dev->state != DEV_STATE_CREATED) { + if (dev->realized) { error_set(errp, QERR_PERMISSION_DENIED); return; } @@ -125,7 +125,7 @@ static void set_uint8(Object *obj, Visitor *v, void *opaque, Property *prop = opaque; uint8_t *ptr = qdev_get_prop_ptr(dev, prop); - if (dev->state != DEV_STATE_CREATED) { + if (dev->realized) { error_set(errp, QERR_PERMISSION_DENIED); return; } @@ -192,7 +192,7 @@ static void set_uint16(Object *obj, Visitor *v, void *opaque, Property *prop = opaque; uint16_t *ptr = qdev_get_prop_ptr(dev, prop); - if (dev->state != DEV_STATE_CREATED) { + if (dev->realized) { error_set(errp, QERR_PERMISSION_DENIED); return; } @@ -225,7 +225,7 @@ static void set_uint32(Object *obj, Visitor *v, void *opaque, Property *prop = opaque; uint32_t *ptr = qdev_get_prop_ptr(dev, prop); - if (dev->state != DEV_STATE_CREATED) { + if (dev->realized) { error_set(errp, QERR_PERMISSION_DENIED); return; } @@ -250,7 +250,7 @@ static void set_int32(Object *obj, Visitor *v, void *opaque, Property *prop = opaque; int32_t *ptr = qdev_get_prop_ptr(dev, prop); - if (dev->state != DEV_STATE_CREATED) { + if (dev->realized) { error_set(errp, QERR_PERMISSION_DENIED); return; } @@ -323,7 +323,7 @@ static void set_uint64(Object *obj, Visitor *v, void *opaque, Property *prop = opaque; uint64_t *ptr = qdev_get_prop_ptr(dev, prop); - if (dev->state != DEV_STATE_CREATED) { + if (dev->realized) { error_set(errp, QERR_PERMISSION_DENIED); return; } @@ -413,7 +413,7 @@ static void set_string(Object *obj, Visitor *v, void *opaque, Error *local_err = NULL; char *str; - if (dev->state != DEV_STATE_CREATED) { + if (dev->realized) { error_set(errp, QERR_PERMISSION_DENIED); return; } @@ -477,7 +477,7 @@ static void set_mac(Object *obj, Visitor *v, void *opaque, int i, pos; char *str, *p; - if (dev->state != DEV_STATE_CREATED) { + if (dev->realized) { error_set(errp, QERR_PERMISSION_DENIED); return; } @@ -569,7 +569,7 @@ static void set_pci_devfn(Object *obj, Visitor *v, void *opaque, Error *local_err = NULL; char *str; - if (dev->state != DEV_STATE_CREATED) { + if (dev->realized) { error_set(errp, QERR_PERMISSION_DENIED); return; } @@ -640,7 +640,7 @@ static void set_blocksize(Object *obj, Visitor *v, void *opaque, const int64_t min = 512; const int64_t max = 32768; - if (dev->state != DEV_STATE_CREATED) { + if (dev->realized) { error_set(errp, QERR_PERMISSION_DENIED); return; } @@ -708,7 +708,7 @@ static void set_pci_host_devaddr(Object *obj, Visitor *v, void *opaque, unsigned long dom = 0, bus = 0; unsigned int slot = 0, func = 0; - if (dev->state != DEV_STATE_CREATED) { + if (dev->realized) { error_set(errp, QERR_PERMISSION_DENIED); return; } |