Bug #9985
blkdev devices can have an invalid devid
0%
Description
A hypervisor may expose Virtio emulated block devices to a guest. We have a driver for these devices, vioblk
, which is based on the blkdev
framework.
Unfortunately, the Virtio specification has (at least historically) not required the hypervisor to provide a unique serial number or identifier of any kind for each block device, and at least some common hypervisors elect not to do so. The way this is currently wired up, vioblk
will, when there is no serial number, generate the same devid each time: id1,kdev@A~~~~~~~~~~~~~~~~~~~~
. This confuses many other parts of the system (e.g., the disk management library) which expect a devid to uniquely identify the media behind a particular device.
Other disk devices (including ancient IDE disks, and the Xen emulated xdf
device) will fabricate a devid if none is available naturally. This devid may be persisted to disk if the disk is correctly labelled with room for devid storage, which means the devid will persistently identify the media (even if the /devices
path changes), as intended.
It would appear that we should put the same fabrication logic into blkdev
, so that devices using that framework will correctly fabricate a devid if one does not naturally exist for the attached media.
Related issues