qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Qemu-devel] [PATCH] ppc: exit if compat mode is unknown


From: Greg Kurz
Subject: [Qemu-devel] [PATCH] ppc: exit if compat mode is unknown
Date: Wed, 13 Jul 2016 11:10:21 +0200
User-agent: StGit/0.17.1-dirty

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 <address@hidden>
---
 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);




reply via email to

[Prev in Thread] Current Thread [Next in Thread]