Patchwork [02/23] target-i386: cpu_x86_register(): report error from property setter

login
register
mail settings
Submitter Igor Mammedov
Date Oct. 2, 2012, 3:36 p.m.
Message ID <1349192235-31895-3-git-send-email-imammedo@redhat.com>
Download mbox | patch
Permalink /patch/188553/
State New
Headers show

Comments

Igor Mammedov - Oct. 2, 2012, 3:36 p.m.
Signed-off-by: Igor Mammedov <imammedo@redhat.com>
Reviewed-by: Eduardo Habkost <ehabkost@redhat.com>
---
 v2:
   - replace "if (error_is_set(&error))" with "if (error)"
---
 target-i386/cpu.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)
Andreas Färber - Oct. 10, 2012, 2:07 p.m.
Am 02.10.2012 17:36, schrieb Igor Mammedov:
> Signed-off-by: Igor Mammedov <imammedo@redhat.com>
> Reviewed-by: Eduardo Habkost <ehabkost@redhat.com>

Thanks, queued on qom-cpu branch:
https://github.com/afaerber/qemu-cpu/commits/qom-cpu

Andreas

Patch

diff --git a/target-i386/cpu.c b/target-i386/cpu.c
index e1ffa40..f7ca776 100644
--- a/target-i386/cpu.c
+++ b/target-i386/cpu.c
@@ -1428,7 +1428,8 @@  int cpu_x86_register(X86CPU *cpu, const char *cpu_model)
     object_property_set_str(OBJECT(cpu), def->model_id, "model-id", &error);
 
 out:
-    if (error_is_set(&error)) {
+    if (error) {
+        fprintf(stderr, "%s\n", error_get_pretty(error));
         error_free(error);
         return -1;
     }