diff options
author | Igor Mammedov <imammedo@redhat.com> | 2013-04-26 19:51:52 +0200 |
---|---|---|
committer | Andreas Färber <afaerber@suse.de> | 2013-05-01 13:04:18 +0200 |
commit | 8d6d4980c9421f3b9d1800dbc320da6a0bf754bd (patch) | |
tree | 6c3ccd0424d26397f4bfa37df6d5012df062b023 /target-i386/cpu.c | |
parent | 310509304e1a83c1926471f1984c1cbf7d813631 (diff) |
target-i386: Do not allow to set apic-id once CPU is realized
Signed-off-by: Igor Mammedov <imammedo@redhat.com>
Reviewed-by: Eduardo Habkost <ehabkost@redhat.com>
Signed-off-by: Andreas Färber <afaerber@suse.de>
Diffstat (limited to 'target-i386/cpu.c')
-rw-r--r-- | target-i386/cpu.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/target-i386/cpu.c b/target-i386/cpu.c index f1cecc0904..0d9493d1cc 100644 --- a/target-i386/cpu.c +++ b/target-i386/cpu.c @@ -1284,11 +1284,18 @@ static void x86_cpuid_set_apic_id(Object *obj, Visitor *v, void *opaque, const char *name, Error **errp) { X86CPU *cpu = X86_CPU(obj); + DeviceState *dev = DEVICE(obj); const int64_t min = 0; const int64_t max = UINT32_MAX; Error *error = NULL; int64_t value; + if (dev->realized) { + error_setg(errp, "Attempt to set property '%s' on '%s' after " + "it was realized", name, object_get_typename(obj)); + return; + } + visit_type_int(v, &value, name, &error); if (error) { error_propagate(errp, error); |