]> git.proxmox.com Git - qemu-server.git/commitdiff
PCIe passthrough: fixup: avoid addr conflict and cleanup a bit
authorThomas Lamprecht <t.lamprecht@proxmox.com>
Fri, 6 Sep 2019 17:22:27 +0000 (19:22 +0200)
committerThomas Lamprecht <t.lamprecht@proxmox.com>
Fri, 6 Sep 2019 17:27:30 +0000 (19:27 +0200)
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
PVE/QemuServer/PCI.pm

index 869b1ecbdc645166667a3e405f900ee6ce24d237..e0bc1a24f104aa3beef08aa909cf4ca7c08a8aa2 100644 (file)
@@ -193,11 +193,11 @@ sub get_pcie_addr_map {
        hostpci8bus0 => { bus => "pcie.0", addr => 13 },
        hostpci9bus0 => { bus => "pcie.0", addr => 14 },
        hostpci10bus0 => { bus => "pcie.0", addr => 15 },
-       hostpci11bus0 => { bus => "pcie.0", addr => 20 },
-       hostpci12bus0 => { bus => "pcie.0", addr => 21 },
-       hostpci13bus0 => { bus => "pcie.0", addr => 22 },
-       hostpci14bus0 => { bus => "pcie.0", addr => 23 },
-       hostpci15bus0 => { bus => "pcie.0", addr => 24 },
+       hostpci11bus0 => { bus => "pcie.0", addr => 21 },
+       hostpci12bus0 => { bus => "pcie.0", addr => 22 },
+       hostpci13bus0 => { bus => "pcie.0", addr => 23 },
+       hostpci14bus0 => { bus => "pcie.0", addr => 24 },
+       hostpci15bus0 => { bus => "pcie.0", addr => 25 },
     } if !defined($pcie_addr_map);
 
     return $pcie_addr_map;
@@ -222,15 +222,13 @@ sub print_pcie_root_port {
     my ($i) = @_;
     my $res = '';
 
-    my $id = $i + 1;
-
     my $root_port_addresses = {
-       4 => "10.0",
-       5 => "10.1",
-       6 => "10.2",
-       7 => "10.3",
-       8 => "10.4",
-       9 => "10.5",
+        4 => "10.0",
+        5 => "10.1",
+        6 => "10.2",
+        7 => "10.3",
+        8 => "10.4",
+        9 => "10.5",
        10 => "10.6",
        11 => "10.7",
        12 => "11.0",
@@ -240,6 +238,7 @@ sub print_pcie_root_port {
     };
 
     if (defined($root_port_addresses->{$i})) {
+       my $id = $i + 1;
        $res = "pcie-root-port,id=ich9-pcie-port-${id}";
        $res .= ",addr=$root_port_addresses->{$i}";
        $res .= ",x-speed=16,x-width=32,multifunction=on,bus=pcie.0";