[pve-devel] [PATCH qemu-server] hostpci: bring back multifunction pass-through shortcut

Wolfgang Bumiller w.bumiller at proxmox.com
Wed Aug 24 09:55:49 CEST 2016


---
Can someone with a multi-function pci device test this please?

 PVE/QemuServer.pm | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/PVE/QemuServer.pm b/PVE/QemuServer.pm
index 46f8fdc..af8a15c 100644
--- a/PVE/QemuServer.pm
+++ b/PVE/QemuServer.pm
@@ -1674,7 +1674,12 @@ sub parse_hostpci {
     delete $res->{host};
     foreach my $id (@idlist) {
 	if ($id =~ /^$PCIRE$/) {
-	    push @{$res->{pciid}}, { id => $1, function => ($2//'0') };
+	    if (defined($2)) {
+		push @{$res->{pciid}}, { id => $1, function => $2 };
+	    } else {
+		my $pcidevices = lspci($1);
+		$res->{pciid} = $pcidevices->{$1};
+	    }
 	} else {
 	    # should have been caught by parse_property_string already
 	    die "failed to parse PCI id: $id\n";
-- 
2.1.4





More information about the pve-devel mailing list