Patchwork [qom-cpu,for-1.4,13/14] target-openrisc: Catch attempt to instantiate abstract type in cpu_init()

login
register
mail settings
Submitter Andreas Färber
Date Jan. 23, 2013, 12:07 p.m.
Message ID <1358942867-8612-14-git-send-email-afaerber@suse.de>
Download mbox | patch
Permalink /patch/214928/
State New
Headers show

Comments

Andreas Färber - Jan. 23, 2013, 12:07 p.m.
Fixes -cpu openrisc-cpu asserting.

Cc: qemu-stable@nongnu.org
Signed-off-by: Andreas Färber <afaerber@suse.de>
---
 target-openrisc/cpu.c |    3 ++-
 1 Datei geändert, 2 Zeilen hinzugefügt(+), 1 Zeile entfernt(-)

Patch

diff --git a/target-openrisc/cpu.c b/target-openrisc/cpu.c
index 6f41930..2ca6787 100644
--- a/target-openrisc/cpu.c
+++ b/target-openrisc/cpu.c
@@ -98,7 +98,8 @@  static ObjectClass *openrisc_cpu_class_by_name(const char *cpu_model)
     }
 
     oc = object_class_by_name(cpu_model);
-    if (oc != NULL && object_class_dynamic_cast(oc, TYPE_OPENRISC_CPU)) {
+    if (oc != NULL && (object_class_dynamic_cast(oc, TYPE_OPENRISC_CPU) ||
+                       object_class_is_abstract(oc))) {
         return NULL;
     }
     return oc;