target-openrisc hw/openrisc: Two OpenRISC fix.
cover target-openrisc hw/openrisc: Two OpenRISC fix.
Fix OpenRISC CPU and sim broad, in cpu.c we should free typename, and in openrisc_sim.c we should use stderr output.
Jia Liu (2):
target-openrisc: free typename in cpu_class_by_name hw/openrisc: Use stderr output instead of qemu_log
hw/openrisc/openrisc_sim.c | 2 +- target-openrisc/cpu.c | 1 + 2 files changed, 2 insertions(+), 1 deletion(-)
Signature · 1 line
1.7.12.4 (Apple Git-37)
PATCH 1/2 target-openrisc: Free typename in cpu_class_by_name
Add a g_free into openrisc_cpu_class_by_name to free typename.
Signed-off-by Jia Liu <[email protected]>
--- target-openrisc/cpu.c | 1 + 1 file changed, 1 insertion(+)
target-openrisc/cpu.c +1 -0
@@ -99,6 +99,7 @@ static ObjectClass *openrisc_cpu_class_by_name(const char *cpu_model) typename =g_strdup_printf ("%s-" TYPE_OPENRISC_CPU , cpu_model); oc =object_class_by_name (typename); +g_free (typename);if (oc !=NULL && (!object_class_dynamic_cast (oc,TYPE_OPENRISC_CPU ) ||object_class_is_abstract (oc))) {return NULL ;
Signature · 1 line
1.7.12.4 (Apple Git-37)
PATCH 2/2 hw/openrisc: Use stderr output instead of qemu_log
In reply to Jia LiuHere should be stderr output instead of qemu_log.
Signed-off-by Jia Liu <[email protected]>
--- hw/openrisc/openrisc_sim.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
hw/openrisc/openrisc_sim.c +1 -1
@@ -107,7 +107,7 @@ static void openrisc_sim_init(QEMUMachineInitArgs *args)for (n =0 ; n < smp_cpus; n++) { cpu =cpu_openrisc_init (cpu_model);if (cpu ==NULL ) { -qemu_log ("Unable to find CPU definition!\n" ); +fprintf (stderr,"Unable to find CPU definition!\n" );exit (1 ); }qemu_register_reset (main_cpu_reset, cpu);
Signature · 1 line
1.7.12.4 (Apple Git-37)