Skip to contentSkip to conversation

target-openrisc hw/openrisc: Two OpenRISC fix.

PATCH Superseded Jia Liu 1 participant 3 messages Jul 15, 2013

v1 of 4 Superseded Latest is v4 →

lore
Share & tools
lore

Jia Liu

author
#0 lore raw

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)
author
#1 lore raw

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.

---
 target-openrisc/cpu.c | 1 +
 1 file changed, 1 insertion(+)
target-openrisc/cpu.c +1 -0
index 6d40f1b..e348df0 100644
@@ -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)
author
#2 lore raw

PATCH 2/2 hw/openrisc: Use stderr output instead of qemu_log

In reply to Jia Liu

Here should be stderr output instead of qemu_log.

---
 hw/openrisc/openrisc_sim.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
hw/openrisc/openrisc_sim.c +1 -1
index 924438b..26bff75 100644
@@ -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)