From 221254a582ef2e6d950db65bfe83c5ebbfd633a7 Mon Sep 17 00:00:00 2001 From: Henning Schild Date: Tue, 27 Jan 2015 15:05:30 +0100 Subject: [PATCH] tools: config create: do not use the class file of pci devs anymore The class file just contains the classcode. Since we started also using the file containing the whole PCI config space we might as well get the class information from there and copy/access less input files. Signed-off-by: Henning Schild Signed-off-by: Jan Kiszka --- tools/jailhouse-config-create | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/tools/jailhouse-config-create b/tools/jailhouse-config-create index ed7db33..e870d56 100755 --- a/tools/jailhouse-config-create +++ b/tools/jailhouse-config-create @@ -77,7 +77,6 @@ inputs['files'].add('/proc/cpuinfo') inputs['files'].add('/proc/cmdline') inputs['files'].add('/proc/ioports') inputs['files'].add('/sys/bus/pci/devices/*/config') -inputs['files'].add('/sys/bus/pci/devices/*/class') inputs['files'].add('/sys/devices/system/cpu/cpu*/uevent') inputs['files'].add('/sys/firmware/acpi/tables/APIC') inputs['files'].add('/sys/firmware/acpi/tables/MCFG') @@ -254,8 +253,11 @@ class PCIDevice: @staticmethod def parse_pcidevice_sysfsdir(basedir, dir): dpath = os.path.join(basedir, dir) - dclass = input_readline(os.path.join(dpath, 'class')) - if re.match(r'0x0604..', dclass): + f = input_open(os.path.join(dpath, 'config'), 'rb') + f.seek(0x0A) + (classcode,) = struct.unpack('