]> git.proxmox.com Git - qemu.git/commitdiff
target-i386: Do not allow to set apic-id once CPU is realized
authorIgor Mammedov <imammedo@redhat.com>
Fri, 26 Apr 2013 17:51:52 +0000 (19:51 +0200)
committerAndreas Färber <afaerber@suse.de>
Wed, 1 May 2013 11:04:18 +0000 (13:04 +0200)
Signed-off-by: Igor Mammedov <imammedo@redhat.com>
Reviewed-by: Eduardo Habkost <ehabkost@redhat.com>
Signed-off-by: Andreas Färber <afaerber@suse.de>
target-i386/cpu.c

index f1cecc090421fd33800215ff1a502daac4d87ecd..0d9493d1cc56d8c49a66e32d26f81ed5195bb3ba 100644 (file)
@@ -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);