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
From: "Brian C. Lane" bcl@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. """
But why should we do this for virtio instead of having them report a sane vendor? How many blocks like this are we going to end up with for various drivers/vendors?
But why should we do this for virtio instead of having them report a sane vendor? How many blocks like this are we going to end up with for various drivers/vendors?
Good point, but note that we already override description for subclasses so it isn't a unique situation.
I agree with @dwlehman that this should be fixed in the kernel. I'm okay with this as a workaround as long as the bug report is filed for the kernel to fix this nonsense.
Closed.
anaconda-patches@lists.fedorahosted.org