qvm-pci: fix PCI device id (BDF) regexp

Actually BDF is in hex...

Fixes QubesOS/qubes-issues#1461
This commit is contained in:
Marek Marczykowski-Górecki 2015-11-27 22:56:55 +01:00
parent b114d291ca
commit 67ca619ee5
No known key found for this signature in database
GPG Key ID: 063938BA42CFA724

View File

@ -38,8 +38,8 @@ def find_devices_of_class(klass):
print "ERROR when executing lspci!" print "ERROR when executing lspci!"
raise IOError raise IOError
rx_netdev = re.compile(r"^([0-9][0-9]:[0-9][0-9].[0-9]) \"{}".format( rx_netdev = re.compile(r"^([0-9a-f]{2}:[0-9a-f]{2}.[0-9a-f]) \"" +
klass)) klass)
for dev in str(result[0]).splitlines(): for dev in str(result[0]).splitlines():
match = rx_netdev.match(dev) match = rx_netdev.match(dev)
if match is not None: if match is not None: