On 11/12/2020 22:05, Eduardo Habkost wrote:

sparc_set_nwindows() is one of the very few property setters that
don't check dev->realized, and there's no reason for it to be
special.  Check dev->realized like the other setters.

Reviewed-by: Marc-AndrĂ© Lureau <[email protected]>
Signed-off-by: Eduardo Habkost <[email protected]>
---
Cc: Mark Cave-Ayland <[email protected]>
Cc: Artyom Tarasenko <[email protected]>
Cc: [email protected]
---
  target/sparc/cpu.c | 6 ++++++
  1 file changed, 6 insertions(+)

diff --git a/target/sparc/cpu.c b/target/sparc/cpu.c
index 701e794eac..6a3299041f 100644
--- a/target/sparc/cpu.c
+++ b/target/sparc/cpu.c
@@ -798,11 +798,17 @@ static void sparc_get_nwindows(Object *obj, Visitor *v, 
const char *name,
  static void sparc_set_nwindows(Object *obj, Visitor *v, const char *name,
                                 void *opaque, Error **errp)
  {
+    DeviceState *dev = DEVICE(obj);
      const int64_t min = MIN_NWINDOWS;
      const int64_t max = MAX_NWINDOWS;
      SPARCCPU *cpu = SPARC_CPU(obj);
      int64_t value;
+ if (dev->realized) {
+        qdev_prop_set_after_realize(dev, name, errp);
+        return;
+    }
+
      if (!visit_type_int(v, name, &value, errp)) {
          return;
      }

Acked-by: Mark Cave-Ayland <[email protected]>


ATB,

Mark.

Reply via email to