Skip to content

Commit

Permalink
Translate vendor id 0x1af4 to Virtio Block Device (#1242117)
Browse files Browse the repository at this point in the history
The vendor information used to come from parted which reports virtio blk
devices as 'Virtio Block Device'. The sysfs vendor entry has always been
0x1af4 which isn't very descriptive. So in disk.description check for
the exception and return "Virtio Block Device". disk.vendor is left
as-is, only the user friendly description is modified.

Resolves: rhbz#1242117
  • Loading branch information
bcl authored and vojtechtrefny committed Nov 4, 2024
1 parent 5162f0c commit 874f8f5
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion blivet/devices/disk.py
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,11 @@ def media_present(self):

@property
def description(self):
return " ".join(s for s in (self.vendor, self.model, self.wwn) if s)
# On Virtio block devices the vendor is 0x1af4, make it more friendly
if self.vendor == "0x1af4":
return "Virtio Block Device"
else:
return " ".join(s for s in (self.vendor, self.model, self.wwn) if s)

def _pre_destroy(self):
""" Destroy the device. """
Expand Down

0 comments on commit 874f8f5

Please sign in to comment.