def get_dev_prefix_for_disk_bus(disk_bus):

    if CONF.libvirt.disk_prefix:
        return CONF.libvirt.disk_prefix
    if disk_bus == "ide":
        return "hd"
    elif disk_bus == "virtio":
        return "vd"
    elif disk_bus == "xen":
        return "xvd"
    elif disk_bus == "scsi":
        return "sd"
    elif disk_bus == "usb":
        return "sd"
    elif disk_bus == "fdc":
        return "fd"
    elif disk_bus == "uml":
        return "ubd"
    elif disk_bus == "lxc":
        return None
    elif disk_bus == "sata":
        return "sd"
    else:
        raise exception.NovaException(
            _("Unable to determine disk prefix for %s") %
            disk_bus)
Determine the dev prefix for a disk bus.
dataset/ETHPy150Open BU-NU-CLOUD-SP16/Trusted-Platform-Module-nova/nova/virt/libvirt/blockinfo.py/get_dev_prefix_for_disk_bus