From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:38159) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bNJNO-0002xS-U4 for qemu-devel@nongnu.org; Wed, 13 Jul 2016 08:34:55 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bNJNL-0000dV-IV for qemu-devel@nongnu.org; Wed, 13 Jul 2016 08:34:54 -0400 Received: from 6.mo178.mail-out.ovh.net ([46.105.53.132]:40720) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bNJNL-0000ak-Be for qemu-devel@nongnu.org; Wed, 13 Jul 2016 08:34:51 -0400 Received: from player169.ha.ovh.net (b9.ovh.net [213.186.33.59]) by mo178.mail-out.ovh.net (Postfix) with ESMTP id 3550D100883B for ; Wed, 13 Jul 2016 14:34:38 +0200 (CEST) Date: Wed, 13 Jul 2016 14:34:32 +0200 From: Greg Kurz Message-ID: <20160713143432.01ccb05e@bahia.lan> In-Reply-To: <146840102187.900.13546085522655887765.stgit@bahia.lan> References: <146840102187.900.13546085522655887765.stgit@bahia.lan> MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [Qemu-ppc] [PATCH] ppc: exit if compat mode is unknown List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: David Gibson Cc: qemu-ppc@nongnu.org, qemu-devel@nongnu.org, Bharata B Rao On Wed, 13 Jul 2016 11:10:21 +0200 Greg Kurz wrote: > Now that properties are set with -global, if we pass a bogus value for > compat mode, a warning is printed and the property is simply ignored. > For example, if the host is POWER8 and we pass compat=POWER7 instead of > compat=power7 the guest will see a POWER8 cpu. > > While here, this patch also changes the error message to be more explicit. > > Signed-off-by: Greg Kurz > --- Of course this causes qom-set to exit as well... not sure this is what we want. > target-ppc/translate_init.c | 6 +++++- > 1 file changed, 5 insertions(+), 1 deletion(-) > > diff --git a/target-ppc/translate_init.c b/target-ppc/translate_init.c > index 8f257fb74aa7..55688db9c9db 100644 > --- a/target-ppc/translate_init.c > +++ b/target-ppc/translate_init.c > @@ -8475,7 +8475,11 @@ static void powerpc_set_compat(Object *obj, Visitor *v, const char *name, > } else if (strcmp(value, "power8") == 0) { > *max_compat = CPU_POWERPC_LOGICAL_2_07; > } else { > - error_setg(errp, "Invalid compatibility mode \"%s\"", value); > + /* This is called from -global, which does not exit on error. Since we > + * don't want to start with a wrong compat mode, we exit now. > + */ > + error_report("PPC does not support compatibility mode \"%s\"", value); > + exit(1); > } > > g_free(value); > >