Patchwork [06/17] target-i386: cpu_x86_init(): print error message in case of error

login
register
mail settings
Submitter Eduardo Habkost
Date Nov. 12, 2012, 9:38 p.m.
Message ID <1352756342-13716-7-git-send-email-ehabkost@redhat.com>
Download mbox | patch
Permalink /patch/198484/
State New
Headers show

Comments

Eduardo Habkost - Nov. 12, 2012, 9:38 p.m.
Error information is being ignored and never returned to the caller.

While we don't change cpu_x86_init() to not return error information, print
error message inside cpu_x86_init() in case of error.

Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
---
Changes v2:
 - Use error_report()
 - Add "cpu_x86_init:" prefix to error message
---
 target-i386/cpu.c | 1 +
 1 file changed, 1 insertion(+)

Patch

diff --git a/target-i386/cpu.c b/target-i386/cpu.c
index 69f1204..2907fb0 100644
--- a/target-i386/cpu.c
+++ b/target-i386/cpu.c
@@ -1517,6 +1517,7 @@  X86CPU *cpu_x86_init(const char *cpu_model)
 error:
     object_delete(OBJECT(cpu));
     if (error) {
+        error_report("cpu_x86_init: %s", error_get_pretty(error));
         error_free(error);
     }
     return NULL;