Patchwork [04/66] target-ppc: Update error handling in ppc_cpu_realize()

login
register
mail settings
Submitter Alexander Graf
Date March 8, 2013, 8:06 p.m.
Message ID <1362773228-1747-5-git-send-email-agraf@suse.de>
Download mbox | patch
Permalink /patch/226271/
State New
Headers show

Comments

Alexander Graf - March 8, 2013, 8:06 p.m.
From: Andreas Färber <afaerber@suse.de>

Commit fe828a4d4b7a5617cda7b24e95e327bfb71d790e added a new fatal error
message while QOM realize'ification was in flight.

Convert it to return an Error instead of exit()ing.

Signed-off-by: Andreas Färber <afaerber@suse.de>
Signed-off-by: Alexander Graf <agraf@suse.de>
---
 target-ppc/translate_init.c |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

Patch

diff --git a/target-ppc/translate_init.c b/target-ppc/translate_init.c
index d2706f7..d00c737 100644
--- a/target-ppc/translate_init.c
+++ b/target-ppc/translate_init.c
@@ -10043,9 +10043,9 @@  static void ppc_cpu_realizefn(DeviceState *dev, Error **errp)
 
 #if !defined(CONFIG_USER_ONLY)
     if (smp_threads > max_smt) {
-        fprintf(stderr, "Cannot support more than %d threads on PPC with %s\n",
-                max_smt, kvm_enabled() ? "KVM" : "TCG");
-        exit(1);
+        error_setg(errp, "Cannot support more than %d threads on PPC with %s",
+                   max_smt, kvm_enabled() ? "KVM" : "TCG");
+        return;
     }
 #endif