]> git.proxmox.com Git - qemu.git/commitdiff
target-alpha: Detect attempt to instantiate non-CPU type in cpu_init()
authorAndreas Färber <afaerber@suse.de>
Mon, 21 Jan 2013 16:27:54 +0000 (17:27 +0100)
committerAndreas Färber <afaerber@suse.de>
Sun, 27 Jan 2013 13:52:05 +0000 (14:52 +0100)
Check in alpha_cpu_class_by_name() whether the type found is actually
(a sub-type of) TYPE_ALPHA_CPU.

This fixes, e.g., -cpu typhoon-pcihost asserting.

Signed-off-by: Andreas Färber <afaerber@suse.de>
target-alpha/cpu.c

index 3ac0fde2cdaf32aa3873eaa988077bc7d89f2691..0d6975ea9b231fefded850c64ec192f0b5f16210 100644 (file)
@@ -96,7 +96,7 @@ static ObjectClass *alpha_cpu_class_by_name(const char *cpu_model)
     }
 
     oc = object_class_by_name(cpu_model);
-    if (oc != NULL) {
+    if (oc != NULL && object_class_dynamic_cast(oc, TYPE_ALPHA_CPU) != NULL) {
         return oc;
     }