]> git.proxmox.com Git - qemu-server.git/commitdiff
fix hostpci addr
authorDerumier Alexandre <aderumier@odiso.com>
Mon, 3 Oct 2011 12:53:09 +0000 (14:53 +0200)
committerDietmar Maurer <dietmar@proxmox.com>
Tue, 4 Oct 2011 05:54:16 +0000 (07:54 +0200)
Signed-off-by: Derumier Alexandre <aderumier@odiso.com>
PVE/QemuServer.pm

index 27bccc7209c64e0cab8a1eb069ac50d042cfe8b5..e7a053b1a3e3b8fecca566082ac321091842714f 100644 (file)
@@ -1945,7 +1945,7 @@ sub config_to_command {
     my ($storecfg, $vmid, $conf, $defaults, $migrate_uri) = @_;
 
     my $cmd = [];
-
+    my $pciaddr = '';
     my $kvmver = kvm_user_version();
     my $vernum = 0; # unknown
     if ($kvmver =~ m/^(\d+)\.(\d+)\.(\d+)$/) {
@@ -1986,7 +1986,8 @@ sub config_to_command {
     for (my $i = 0; $i < $MAX_HOSTPCI_DEVICES; $i++)  {
           my $d = parse_hostpci($conf->{"hostpci$i"});
           next if !$d;
-          push @$cmd, '-device', "pci-assign,host=$d->{pciid},id=hostpci$i";
+         $pciaddr = print_pci_addr("hostpci$i");
+          push @$cmd, '-device', "pci-assign,host=$d->{pciid},id=hostpci$i$pciaddr";
     }
 
     # usb devices
@@ -2098,7 +2099,7 @@ sub config_to_command {
     #my $soundhw = $conf->{soundhw} || $defaults->{soundhw};
     #push @$cmd, '-soundhw', 'es1370';
     #push @$cmd, '-soundhw', $soundhw if $soundhw;
-    my $pciaddr = print_pci_addr("balloon0");
+    $pciaddr = print_pci_addr("balloon0");
     push @$cmd, '-device', "virtio-balloon-pci,id=balloon0$pciaddr" if $conf->{balloon};
 
     if ($conf->{watchdog}) {
@@ -2806,6 +2807,9 @@ sub print_pci_addr {
        virtio3 => { bus => 0, addr => 13 },
        virtio4 => { bus => 0, addr => 14 },
        virtio5 => { bus => 0, addr => 15 },
+       hostpci0 => { bus => 0, addr => 16 },
+       hostpci1 => { bus => 0, addr => 17 },
+
     };
 
     if (defined($devices->{$id}->{bus}) && defined($devices->{$id}->{addr})) {