Commit 5e6500026030eccd95fb4bdacd9f5d6bbed1d929
1 parent
0d35bf2d
Only allow -cpu host when KVM is enabled
-cpu host is not at all useful when using tcg. Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Showing
1 changed file
with
3 additions
and
4 deletions
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) | @@ -358,11 +358,10 @@ static int cpu_x86_find_by_name(x86_def_t *x86_cpu_def, const char *cpu_model) | ||
358 | break; | 358 | break; |
359 | } | 359 | } |
360 | } | 360 | } |
361 | - if (!def) { | ||
362 | - if (strcmp(name, "host") != 0) { | ||
363 | - goto error; | ||
364 | - } | 361 | + if (kvm_enabled() && strcmp(name, "host") == 0) { |
365 | cpu_x86_fill_host(x86_cpu_def); | 362 | cpu_x86_fill_host(x86_cpu_def); |
363 | + } else if (!def) { | ||
364 | + goto error; | ||
366 | } else { | 365 | } else { |
367 | memcpy(x86_cpu_def, def, sizeof(*def)); | 366 | memcpy(x86_cpu_def, def, sizeof(*def)); |
368 | } | 367 | } |