[pve-devel] [PATCH 2/2] cpuflags : remove enforce for cpumodel=host

Alexandre Derumier aderumier at odiso.com
Wed Jul 8 10:49:07 CEST 2015


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 <aderumier at odiso.com>
---
 PVE/QemuServer.pm | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/PVE/QemuServer.pm b/PVE/QemuServer.pm
index 6400be6..fbb5923 100644
--- a/PVE/QemuServer.pm
+++ b/PVE/QemuServer.pm
@@ -2965,9 +2965,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;
-- 
2.1.4




More information about the pve-devel mailing list