Do not try to use zRAM devices for anything

These devices are mapped into memory, but nonetheless can appear
in lsblk output. Ignore them explicitly.

Change-Id: I2bb595ef29abdc98bd887bdf41c3c7f64cc3a7e6
This commit is contained in:
Dmitry Tantsur 2019-08-07 16:10:51 +02:00
parent 570584f9ab
commit 88796a8936
3 changed files with 12 additions and 1 deletions

View File

@ -305,6 +305,12 @@ def list_all_block_devices(block_type='disk',
raise errors.BlockDeviceError(
'%s must be returned by lsblk.' % ', '.join(sorted(missing)))
# NOTE(dtantsur): zRAM devices can appear in the output of lsblk, but
# we cannot do anything useful with them.
if device['KNAME'].startswith('zram'):
LOG.debug('Skipping zRAM device %s', device)
continue
name = os.path.join('/dev', device['KNAME'])
try:

View File

@ -137,7 +137,8 @@ BLK_DEVICE_TEMPLATE = (
' ROTA="0" TYPE="disk"\n'
'KNAME="sdd" MODEL="NWD-BLP4-1600 " SIZE="1765517033472" '
' ROTA="0" TYPE="disk"\n'
'KNAME="loop0" MODEL="" SIZE="109109248" ROTA="1" TYPE="loop"'
'KNAME="loop0" MODEL="" SIZE="109109248" ROTA="1" TYPE="loop"\n'
'KNAME="zram0" MODEL="" SIZE="" ROTA="0" TYPE="disk"'
)
# NOTE(pas-ha) largest device is 1 byte smaller than 4GiB

View File

@ -0,0 +1,4 @@
---
fixes:
- |
No longer tries to use zRAM devices for anything.