summaryrefslogtreecommitdiffstats
path: root/hw
diff options
context:
space:
mode:
authorEduardo Habkost2020-12-11 23:05:01 +0100
committerEduardo Habkost2020-12-15 16:02:07 +0100
commit85f6f43283d669413045bbba93946f9e08e1c56d (patch)
treeb60486f9271ae3b36557f65bfb734cfb2d883758 /hw
parentqdev: Move property code to qdev-properties.[ch] (diff)
downloadqemu-85f6f43283d669413045bbba93946f9e08e1c56d.tar.gz
qemu-85f6f43283d669413045bbba93946f9e08e1c56d.tar.xz
qemu-85f6f43283d669413045bbba93946f9e08e1c56d.zip
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')
-rw-r--r--hw/core/qdev-properties.c5
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);
}