From: Greg Kurz Date: Wed, 13 Jul 2016 10:00:17 +0000 (+0200) Subject: ppc: abort if compat property contains an unknown value X-Git-Tag: qemu-xen-4.8.0-rc1~111^2~3 X-Git-Url: http://xenbits.xensource.com/gitweb?a=commitdiff_plain;h=c4dfc14b5573d7a2c9731dd3d0cfc20f331f3c87;p=qemu-xen.git ppc: abort if compat property contains an unknown value It is not possible to set the compat property to an unknown value with powerpc_set_compat(). Something must have gone terribly wrong in QEMU, if we detect an "Internal error" in powerpc_get_compat(). Let's abort then. This patch also drops the "max_compat ? *max_compat : -1" construct. It is useless since max_compat is dereferenced a few lines above. Signed-off-by: Greg Kurz Signed-off-by: David Gibson --- diff --git a/target-ppc/translate_init.c b/target-ppc/translate_init.c index 7cb784262c..5ecafc7b8b 100644 --- a/target-ppc/translate_init.c +++ b/target-ppc/translate_init.c @@ -8446,8 +8446,8 @@ static void powerpc_get_compat(Object *obj, Visitor *v, const char *name, case 0: break; default: - error_setg(errp, "Internal error: compat is set to %x", - max_compat ? *max_compat : -1); + error_report("Internal error: compat is set to %x", *max_compat); + abort(); break; }