diff options
author | Eduardo Habkost | 2020-12-11 23:05:02 +0100 |
---|---|---|
committer | Eduardo Habkost | 2020-12-15 16:02:07 +0100 |
commit | 0ea0a42ef6796e1d2cc2734e6a697becdb0cd3ff (patch) | |
tree | f4548b487fe7086f39d675dbe4379a2219edf5b0 /target/sparc | |
parent | qdev: Check dev->realized at set_size() (diff) | |
download | qemu-0ea0a42ef6796e1d2cc2734e6a697becdb0cd3ff.tar.gz qemu-0ea0a42ef6796e1d2cc2734e6a697becdb0cd3ff.tar.xz qemu-0ea0a42ef6796e1d2cc2734e6a697becdb0cd3ff.zip |
sparc: Check dev->realized at sparc_set_nwindows()
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.
Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Message-Id: <20201211220529.2290218-6-ehabkost@redhat.com>
Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
Diffstat (limited to 'target/sparc')
-rw-r--r-- | target/sparc/cpu.c | 6 |
1 files changed, 6 insertions, 0 deletions
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; } |