From 2315b39c8af92abb8965bb09624b22b9ef2005cf Mon Sep 17 00:00:00 2001 From: Alexandre Derumier Date: Sun, 3 Jan 2016 19:05:31 +0100 Subject: [PATCH] disable hyper-v enlightment when xvga is enabled Geforce drivers (> 344.11) crash with code43 error if they detect hyper-v enlighment with pci passtthrough http://awilliam.github.io/presentations/KVM-Forum-2014/#/5/3 Signed-off-by: Alexandre Derumier --- PVE/QemuServer.pm | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/PVE/QemuServer.pm b/PVE/QemuServer.pm index 13e96092..7991f10e 100644 --- a/PVE/QemuServer.pm +++ b/PVE/QemuServer.pm @@ -2758,6 +2758,7 @@ sub config_to_command { push @$devices, '-device', print_tabletdevice_full($conf) if $tablet; + my $nohyperv; # host pci devices for (my $i = 0; $i < $MAX_HOSTPCI_DEVICES; $i++) { my $d = parse_hostpci($conf->{"hostpci$i"}); @@ -2776,6 +2777,7 @@ sub config_to_command { if ($xvga && $xvga ne '') { push @$cpuFlags, 'kvm=off'; $vga = 'none'; + $nohyperv = 1; } my $pcidevices = $d->{pciid}; my $multifunction = 1 if @$pcidevices > 1; @@ -2902,17 +2904,17 @@ sub config_to_command { push @$globalFlags, 'kvm-pit.lost_tick_policy=discard'; push @$cmd, '-no-hpet'; if (qemu_machine_feature_enabled ($machine_type, $kvmver, 2, 3)) { - push @$cpuFlags , 'hv_spinlocks=0x1fff' if !$nokvm; - push @$cpuFlags , 'hv_vapic' if !$nokvm; - push @$cpuFlags , 'hv_time' if !$nokvm; + push @$cpuFlags , 'hv_spinlocks=0x1fff' if !$nokvm && !$nohyperv; + push @$cpuFlags , 'hv_vapic' if !$nokvm && !$nohyperv; + push @$cpuFlags , 'hv_time' if !$nokvm && !$nohyperv; } else { - push @$cpuFlags , 'hv_spinlocks=0xffff' if !$nokvm; + push @$cpuFlags , 'hv_spinlocks=0xffff' if !$nokvm && !$nohyperv; } } if ($ost eq 'win7' || $ost eq 'win8') { - push @$cpuFlags , 'hv_relaxed' if !$nokvm; + push @$cpuFlags , 'hv_relaxed' if !$nokvm && !$nohyperv; } }