From 68f1282882fe3b43b4bc323e03545dc019e2d19a Mon Sep 17 00:00:00 2001 From: Jia Liu Date: Tue, 23 Jul 2013 18:30:09 +0800 Subject: [PATCH 1/3] hw/openrisc: Indent typo MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Indent typo. Signed-off-by: Jia Liu Reviewed-by: Peter Maydell Reviewed-by: Andreas Färber --- hw/openrisc/openrisc_sim.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hw/openrisc/openrisc_sim.c b/hw/openrisc/openrisc_sim.c index 924438bcc2..250f5b5658 100644 --- a/hw/openrisc/openrisc_sim.c +++ b/hw/openrisc/openrisc_sim.c @@ -96,7 +96,7 @@ static void openrisc_sim_init(QEMUMachineInitArgs *args) ram_addr_t ram_size = args->ram_size; const char *cpu_model = args->cpu_model; const char *kernel_filename = args->kernel_filename; - OpenRISCCPU *cpu = NULL; + OpenRISCCPU *cpu = NULL; MemoryRegion *ram; int n; From 4284c0517b12f03da59250a23ee7e9c3581e89c4 Mon Sep 17 00:00:00 2001 From: Jia Liu Date: Tue, 23 Jul 2013 18:31:24 +0800 Subject: [PATCH 2/3] hw/openrisc: Use stderr output instead of qemu_log MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit We should use stderr output instead of qemu_log in order to output ErrMsg onto the screen. Signed-off-by: Jia Liu Reviewed-by: Peter Maydell Reviewed-by: Andreas Färber --- hw/openrisc/openrisc_sim.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/hw/openrisc/openrisc_sim.c b/hw/openrisc/openrisc_sim.c index 250f5b5658..a08f27ce2e 100644 --- a/hw/openrisc/openrisc_sim.c +++ b/hw/openrisc/openrisc_sim.c @@ -82,7 +82,7 @@ static void cpu_openrisc_load_kernel(ram_addr_t ram_size, } if (kernel_size < 0) { - qemu_log("QEMU: couldn't load the kernel '%s'\n", + fprintf(stderr, "QEMU: couldn't load the kernel '%s'\n", kernel_filename); exit(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); From 9b146e9a28bbd9567f5ac6a8e2bcb543aa3b9392 Mon Sep 17 00:00:00 2001 From: Jia Liu Date: Tue, 23 Jul 2013 18:32:30 +0800 Subject: [PATCH 3/3] target-openrisc: Free typename in openrisc_cpu_class_by_name MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit We should free typename here. Signed-off-by: Jia Liu Reviewed-by: Andreas Färber --- target-openrisc/cpu.c | 1 + 1 file changed, 1 insertion(+) diff --git a/target-openrisc/cpu.c b/target-openrisc/cpu.c index 6d40f1b85e..e348df0fef 100644 --- a/target-openrisc/cpu.c +++ b/target-openrisc/cpu.c @@ -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;