[master 6/15] edd: add EddEntry.bios_device_number
vathpela
installerbot-noreply at redhat.com
Wed Oct 28 17:43:41 UTC 2015
From: Peter Jones <pjones at redhat.com>
This lets us tell (and log) which edd entry we're probing.
Signed-off-by: Peter Jones <pjones at redhat.com>
---
blivet/devicelibs/edd.py | 8 ++++++--
1 file changed, 6 insertions(+), 2 deletions(-)
diff --git a/blivet/devicelibs/edd.py b/blivet/devicelibs/edd.py
index 02f2436..a6f290d 100644
--- a/blivet/devicelibs/edd.py
+++ b/blivet/devicelibs/edd.py
@@ -36,6 +36,7 @@
testdata_log = logging.getLogger("testdata")
testdata_log.setLevel(logging.DEBUG)
+re_bios_device_number = re.compile(r'.*/int13_dev(\d+)/*$')
re_host_bus_pci = re.compile(r'^(PCIX|PCI|XPRS|HTPT)\s*(\S*)\s*channel: (\S*)\s*$')
re_interface_atapi = re.compile(r'^ATAPI\s*device: (\S*)\s*lun: (\S*)\s*$')
re_interface_ata = re.compile(r'^ATA\s*device: (\S*)\s*$')
@@ -72,6 +73,10 @@ def __init__(self, sysfspath):
""" sysfspath is the path we're probing
"""
+ match = re_bios_device_number.match(sysfspath)
+ self.bios_device_number = int(match.group(1), base=16)
+ """ The device number from the EDD path """
+
self.sysfslink = None
""" The path /sys/block/BLAH is a symlink link to once we've resolved
that this is a particular device. Used for logging later.
@@ -533,12 +538,11 @@ def match_via_mbrsigs(self, mbr_dict):
def collect_edd_data():
edd_data_dict = {}
- exp = re.compile(r'.*/int13_dev(\d+)$')
globstr = os.path.join(fsroot, "sys/firmware/edd/int13_dev*")
testdata_log.debug("sysfs glob: %s", globstr[len(fsroot):])
for path in glob.glob(globstr):
testdata_log.debug("sysfs glob match: %s", path[len(fsroot):])
- match = exp.match(path)
+ match = re_bios_device_number.match(path)
biosdev = int("0x%s" % (match.group(1),), base=16)
log.debug("edd: found device 0x%x at %s", biosdev, path[len(fsroot):])
edd_data_dict[biosdev] = EddEntry(path[len(fsroot):])
--
To view this commit on github, visit https://github.com/rhinstaller/blivet/commit/32eb2e4c45bddb10a5ea72ded46a9f015fe6f01f
More information about the anaconda-patches
mailing list