[pve-devel] [PATCH] Force CPU vendor

Andreas Steinel A.Steinel at gmail.com
Sat Apr 30 16:33:59 CEST 2016


Signed-off-by: Andreas Steinel <A.Steinel at gmail.com>
---
 PVE/QemuServer.pm | 22 ++++++++++++++++++++++
 1 file changed, 22 insertions(+)

diff --git a/PVE/QemuServer.pm b/PVE/QemuServer.pm
index 0e3a95e..670cf90 100644
--- a/PVE/QemuServer.pm
+++ b/PVE/QemuServer.pm
@@ -3076,6 +3076,28 @@ sub config_to_command {
 
     push @$cpuFlags, 'kvm=off' if $kvm_off;
 
+    if (
+	    ( $cpu =~ m/^Opteron/ ) ||
+	    ( $cpu eq 'athlon' ) ||
+	    ( $cpu eq 'phenom' )
+    ) {
+	    push @$cpuFlags, 'vendor=AuthenticAMD';
+    } else {
+	    if (
+		    ( $cpu =~ m/^pentium/ ) ||
+		    ( $cpu eq 'Conroe' ) ||
+		    ( $cpu eq 'Penryn' ) ||
+		    ( $cpu eq 'Nehalem' ) ||
+		    ( $cpu eq 'Westmere' ) ||
+		    ( $cpu eq 'SandyBridge' ) ||
+		    ( $cpu eq 'IvyBridge' ) ||
+		    ( $cpu =~ m/^Haswell/ ) ||
+		    ( $cpu =~ m/^Broadwell/ )
+	    ) {
+		    push @$cpuFlags, 'vendor=GenuineIntel';
+	    }
+    }
+
     $cpu .= "," . join(',', @$cpuFlags) if scalar(@$cpuFlags);
 
     push @$cmd, '-cpu', $cpu;
-- 
2.6.4 (Apple Git-63)




More information about the pve-devel mailing list