diff options
author | Eduardo Habkost <ehabkost@redhat.com> | 2020-12-11 17:05:01 -0500 |
---|---|---|
committer | Eduardo Habkost <ehabkost@redhat.com> | 2020-12-15 10:02:07 -0500 |
commit | 85f6f43283d669413045bbba93946f9e08e1c56d (patch) | |
tree | b60486f9271ae3b36557f65bfb734cfb2d883758 /hw/core/qdev-properties.c | |
parent | d3fd6e7380b6212a3cd0b9f1304c84d8caa8dcf7 (diff) |
qdev: Check dev->realized at set_size()
This setter is one of the very few property setters that don't
check dev->realized, and there's no reason to make size
properties different from the rest. Add the missing check.
Fixes: e8cd45c78f53 ("qdev: Add SIZE type to qdev properties")
Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Message-Id: <20201211220529.2290218-5-ehabkost@redhat.com>
Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
Diffstat (limited to 'hw/core/qdev-properties.c')
-rw-r--r-- | hw/core/qdev-properties.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/hw/core/qdev-properties.c b/hw/core/qdev-properties.c index 12a053e732..67ae19df05 100644 --- a/hw/core/qdev-properties.c +++ b/hw/core/qdev-properties.c @@ -905,6 +905,11 @@ static void set_size(Object *obj, Visitor *v, const char *name, void *opaque, Property *prop = opaque; uint64_t *ptr = qdev_get_prop_ptr(dev, prop); + if (dev->realized) { + qdev_prop_set_after_realize(dev, name, errp); + return; + } + visit_type_size(v, name, ptr, errp); } |