[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[PATCH v3 04/53] qdev: Check dev->realized at set_size()

From: Eduardo Habkost
Subject: [PATCH v3 04/53] qdev: Check dev->realized at set_size()
Date: Thu, 12 Nov 2020 16:43:01 -0500

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")
Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
Cc: Paolo Bonzini <pbonzini@redhat.com>
Cc: "Daniel P. Berrangé" <berrange@redhat.com>
Cc: Eduardo Habkost <ehabkost@redhat.com>
Cc: qemu-devel@nongnu.org
 hw/core/qdev-properties.c | 5 +++++
 1 file changed, 5 insertions(+)

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);

reply via email to

[Prev in Thread] Current Thread [Next in Thread]