[pve-devel] [PATCH] add win81 ostype and use qemu64 cpumodel if kvm64 is defined

Alexandre Derumier aderumier at odiso.com
Wed Nov 27 06:35:49 CET 2013


see
http://forum.proxmox.com/threads/16206-Windows-Server-2012-R2-and-0x0000005D-Error

Signed-off-by: Alexandre Derumier <aderumier at odiso.com>
---
 PVE/QemuServer.pm |   19 ++++++++++++-------
 1 file changed, 12 insertions(+), 7 deletions(-)

diff --git a/PVE/QemuServer.pm b/PVE/QemuServer.pm
index 50b774d..7392a49 100644
--- a/PVE/QemuServer.pm
+++ b/PVE/QemuServer.pm
@@ -245,7 +245,7 @@ my $confdesc = {
     ostype => {
 	optional => 1,
 	type => 'string',
-        enum => [qw(other wxp w2k w2k3 w2k8 wvista win7 win8 l24 l26 solaris)],
+        enum => [qw(other wxp w2k w2k3 w2k8 wvista win7 win8 win81 l24 l26 solaris)],
 	description => <<EODESC,
 Used to enable special optimization/features for specific
 operating systems:
@@ -258,12 +258,13 @@ w2k8   => Microsoft Windows 2008
 wvista => Microsoft Windows Vista
 win7   => Microsoft Windows 7
 win8   => Microsoft Windows 8/2012
+win81   => Microsoft Windows 8.1/2012R2
 l24    => Linux 2.4 Kernel
 l26    => Linux 2.6/3.X Kernel
 solaris => solaris/opensolaris/openindiania kernel
 
 other|l24|l26|solaris                       ... no special behaviour
-wxp|w2k|w2k3|w2k8|wvista|win7|win8  ... use --localtime switch
+wxp|w2k|w2k3|w2k8|wvista|win7|win8|win81  ... use --localtime switch
 EODESC
     },
     boot => {
@@ -337,7 +338,7 @@ EODESC
     vga => {
 	optional => 1,
 	type => 'string',
-	description => "Select VGA type. If you want to use high resolution modes (>= 1280x1024x16) then you should use option 'std' or 'vmware'. Default is 'std' for win8/win7/w2k8, and 'cirrur' for other OS types. Option 'qxl' enables the SPICE display sever. You can also run without any graphic card using a serial devive as terminal.",
+	description => "Select VGA type. If you want to use high resolution modes (>= 1280x1024x16) then you should use option 'std' or 'vmware'. Default is 'std' for win8.1/win8/win7/w2k8, and 'cirrur' for other OS types. Option 'qxl' enables the SPICE display sever. You can also run without any graphic card using a serial devive as terminal.",
 	enum => [qw(std cirrus vmware qxl serial0 serial1 serial2 serial3 qxl2 qxl3 qxl4)],
     },
     watchdog => {
@@ -717,6 +718,7 @@ sub os_list_description {
 	wvista => 'Windows Vista',
 	win7 => 'Windows 7',
 	win8 => 'Windows 8/2012',
+	win81 => 'Windows 8.1/2012R2',
 	l24 => 'Linux 2.4',
 	l26 => 'Linux 2.6',
     };
@@ -2299,7 +2301,8 @@ sub config_to_command {
     $vga = 'qxl' if $qxlnum;
 
     if (!$vga) {
-	if ($conf->{ostype} && ($conf->{ostype} eq 'win8' || 
+	if ($conf->{ostype} && ($conf->{ostype} eq 'win81' ||
+				$conf->{ostype} eq 'win8' || 
 				$conf->{ostype} eq 'win7' || 
 				$conf->{ostype} eq 'w2k8')) {
 	    $vga = 'std';
@@ -2405,7 +2408,7 @@ sub config_to_command {
     my $useLocaltime = $conf->{localtime};
 
     if (my $ost = $conf->{ostype}) {
-	# other, wxp, w2k, w2k3, w2k8, wvista, win7, win8, l24, l26, solaris
+	# other, wxp, w2k, w2k3, w2k8, wvista, win7, win8,win81 l24, l26, solaris
 
 	if ($ost =~ m/^w/) { # windows
 	    $useLocaltime = 1 if !defined($conf->{localtime});
@@ -2416,7 +2419,7 @@ sub config_to_command {
 	    }
 	}
 
-	if ($ost eq 'win7' || $ost eq 'win8' || $ost eq 'w2k8' ||
+	if ($ost eq 'win7' || $ost eq 'win8' || $ost eq 'win81' || $ost eq 'w2k8' ||
 	    $ost eq 'wvista') {
 	    push @$globalFlags, 'kvm-pit.lost_tick_policy=discard';
 	    push @$cmd, '-no-hpet';
@@ -2424,7 +2427,7 @@ sub config_to_command {
 	    push @$cpuFlags , 'hv_spinlocks=0xffff' if !$nokvm;
 	}
 
-	if ($ost eq 'win7' || $ost eq 'win8') {
+	if ($ost eq 'win7' || $ost eq 'win8' || $ost eq 'win81') {
 	    push @$cpuFlags , 'hv_relaxed' if !$nokvm;
 	}
     }
@@ -2451,6 +2454,8 @@ sub config_to_command {
     my $cpu = $nokvm ? "qemu64" : "kvm64";
     $cpu = $conf->{cpu} if $conf->{cpu};
 
+    $cpu = 'qemu64' if $cpu eq 'kvm64' && $conf->{ostype} eq 'win81';
+
     push @$cpuFlags , '+x2apic' if !$nokvm && $conf->{ostype} ne 'solaris';
 
     push @$cpuFlags , '-x2apic' if $conf->{ostype} eq 'solaris';
-- 
1.7.10.4



More information about the pve-devel mailing list