From dac7c6190c322cbbcadddf511ec3e66aa7f24c70 Mon Sep 17 00:00:00 2001 From: Alexandre Derumier Date: Wed, 8 Jul 2015 10:49:07 +0200 Subject: [PATCH] cpuflags : remove enforce for cpumodel=host Currently enforce with cpumodel=host on amd cpus don't work, because amd cpus have unsupported flags in qemu. This is a protection, and this is good. but cpumodel host should be never use by users for production (only for testing). For production and stability, users need to choose a true cpu model which filter the supported cpuflags by qemu. So I think we can remove the enforce for host model as for testing it's ok. warning: host doesn't support requested feature: CPUID.80000001H:EDX [bit 0] warning: host doesn't support requested feature: CPUID.80000001H:EDX [bit 1] warning: host doesn't support requested feature: CPUID.80000001H:EDX [bit 2] warning: host doesn't support requested feature: CPUID.80000001H:EDX [bit 3] warning: host doesn't support requested feature: CPUID.80000001H:EDX [bit 4] warning: host doesn't support requested feature: CPUID.80000001H:EDX [bit 5] warning: host doesn't support requested feature: CPUID.80000001H:EDX [bit 6] warning: host doesn't support requested feature: CPUID.80000001H:EDX [bit 7] warning: host doesn't support requested feature: CPUID.80000001H:EDX [bit 8] warning: host doesn't support requested feature: CPUID.80000001H:EDX [bit 9] warning: host doesn't support requested feature: CPUID.80000001H:EDX [bit 12] warning: host doesn't support requested feature: CPUID.80000001H:EDX [bit 13] warning: host doesn't support requested feature: CPUID.80000001H:EDX [bit 14] warning: host doesn't support requested feature: CPUID.80000001H:EDX [bit 15] warning: host doesn't support requested feature: CPUID.80000001H:EDX [bit 16] warning: host doesn't support requested feature: CPUID.80000001H:EDX [bit 17] warning: host doesn't support requested feature: CPUID.80000001H:EDX [bit 23] warning: host doesn't support requested feature: CPUID.80000001H:EDX [bit 24] Signed-off-by: Alexandre Derumier --- PVE/QemuServer.pm | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/PVE/QemuServer.pm b/PVE/QemuServer.pm index f55e8d9a..5ef814b1 100644 --- a/PVE/QemuServer.pm +++ b/PVE/QemuServer.pm @@ -2850,9 +2850,11 @@ sub config_to_command { push @$cpuFlags , '+kvm_pv_eoi' if !$nokvm; } + push @$cpuFlags, 'enforce' if $cpu ne 'host'; + $cpu .= "," . join(',', @$cpuFlags) if scalar(@$cpuFlags); - push @$cmd, '-cpu', "$cpu,enforce"; + push @$cmd, '-cpu', $cpu; my $memory = $conf->{memory} || $defaults->{memory}; my $static_memory = 0;