target-openrisc: Detect attempt to instantiate non-CPU type in cpu_init()
authorAndreas Färber <afaerber@suse.de>
Wed, 23 Jan 2013 10:17:14 +0000 (11:17 +0100)
committerAndreas Färber <afaerber@suse.de>
Sun, 27 Jan 2013 13:52:05 +0000 (14:52 +0100)
commitbd039ce0094f3724a87a193c846ee8468ce652b0
tree4ab008106e68fb70734fedd2a0e5a7961be63c1d
parentbc5b2da32ba54d991e8669b14a771afb3a67f408
target-openrisc: Detect attempt to instantiate non-CPU type in cpu_init()

Consolidate model checking into a new openrisc_cpu_class_by_name().

If the name matches an existing type, also check whether that type is
actually (a sub-type of) TYPE_OPENRISC_CPU.

This fixes, e.g., -cpu open_eth asserting.

Cc: qemu-stable@nongnu.org
Signed-off-by: Andreas Färber <afaerber@suse.de>
target-openrisc/cpu.c