From 8d6d4980c9421f3b9d1800dbc320da6a0bf754bd Mon Sep 17 00:00:00 2001 From: Igor Mammedov Date: Fri, 26 Apr 2013 19:51:52 +0200 Subject: target-i386: Do not allow to set apic-id once CPU is realized MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Igor Mammedov Reviewed-by: Eduardo Habkost Signed-off-by: Andreas Färber --- target-i386/cpu.c | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'target-i386/cpu.c') 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); -- cgit v1.2.1