]> git.proxmox.com Git - qemu-server.git/commitdiff
add win7 pcie quirk
authorDominik Csapak <d.csapak@proxmox.com>
Mon, 17 Dec 2018 12:57:08 +0000 (13:57 +0100)
committerThomas Lamprecht <t.lamprecht@proxmox.com>
Mon, 17 Dec 2018 13:00:23 +0000 (14:00 +0100)
Win7 is very picky about pcie assignments and fails with
'error 12' the way we add hospci devices.

To combat that, we simply give the hostpci device a normal port
instead.

Start with address 0x10, so that we have space before those devices,
and between them and the ones configured in pve-q35.cfg should we
need it in the future.

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
PVE/QemuServer.pm
PVE/QemuServer/PCI.pm

index 38b511e90bb6b80cc068e00e798db6801d7c9e25..8b09bcdc5c742da5f15d8b9ed37f76d94852afd8 100644 (file)
@@ -3524,7 +3524,13 @@ sub config_to_command {
        my $pcie = $d->{pcie};
        if($pcie){
            die "q35 machine model is not enabled" if !$q35;
-           $pciaddr = print_pcie_addr("hostpci$i");
+           # win7 wants to have the pcie devices directly on the pcie bus
+           # instead of in the root port
+           if ($winversion == 7) {
+               $pciaddr = print_pcie_addr("hostpci${i}bus0");
+           } else {
+               $pciaddr = print_pcie_addr("hostpci$i");
+           }
        }else{
            $pciaddr = print_pci_addr("hostpci$i", $bridges, $arch, $machine_type);
        }
index 29b894319e60267674f889eb564589198d8950bd..f22f5adbb09a47b61554335b9285989b38414312 100644 (file)
@@ -145,6 +145,11 @@ sub print_pcie_addr {
        hostpci1 => { bus => "ich9-pcie-port-2", addr => 0 },
        hostpci2 => { bus => "ich9-pcie-port-3", addr => 0 },
        hostpci3 => { bus => "ich9-pcie-port-4", addr => 0 },
+       # win7 is picky about pcie assignments
+       hostpci0bus0 => { bus => "pcie.0", addr => 16 },
+       hostpci1bus0 => { bus => "pcie.0", addr => 17 },
+       hostpci2bus0 => { bus => "pcie.0", addr => 18 },
+       hostpci3bus0 => { bus => "pcie.0", addr => 19 },
     };
 
     if (defined($devices->{$id}->{bus}) && defined($devices->{$id}->{addr})) {