[master 1/1] Translate vendor id 0x1af4 to Virtio Block Device (#1242117)
bcl
installerbot-noreply at redhat.com
Tue Jul 14 19:27:16 UTC 2015
From: "Brian C. Lane" <bcl at redhat.com>
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
---
blivet/devices/disk.py | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/blivet/devices/disk.py b/blivet/devices/disk.py
index 6221a22..b585763 100644
--- a/blivet/devices/disk.py
+++ b/blivet/devices/disk.py
@@ -111,7 +111,11 @@ def mediaPresent(self):
@property
def description(self):
- return " ".join(s for s in (self.vendor, self.model) 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) if s)
def _preDestroy(self):
""" Destroy the device. """
--
To view this commit on github, visit https://github.com/rhinstaller/blivet/commit/a9e601a2997bd494192a4e9c47e45a286293b247
More information about the anaconda-patches
mailing list