From 8fe7911401747e3687e7215140a81d671d7f789a Mon Sep 17 00:00:00 2001 From: Anthony Liguori Date: Thu, 16 Jul 2009 22:20:22 -0500 Subject: [PATCH] Only allow -cpu host when KVM is enabled -cpu host is not at all useful when using tcg. Signed-off-by: Anthony Liguori --- target-i386/helper.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/target-i386/helper.c b/target-i386/helper.c index 5f335331b1..dd898852c5 100644 --- a/target-i386/helper.c +++ b/target-i386/helper.c @@ -358,11 +358,10 @@ static int cpu_x86_find_by_name(x86_def_t *x86_cpu_def, const char *cpu_model) break; } } - if (!def) { - if (strcmp(name, "host") != 0) { - goto error; - } + if (kvm_enabled() && strcmp(name, "host") == 0) { cpu_x86_fill_host(x86_cpu_def); + } else if (!def) { + goto error; } else { memcpy(x86_cpu_def, def, sizeof(*def)); }