def has_disk_dev(mapping, disk_dev):

    for disk in mapping:
        info = mapping[disk]
        if info['dev'] == disk_dev:
            return True
    return False
Determine if a disk device name has already been used.
dataset/ETHPy150Open BU-NU-CLOUD-SP16/Trusted-Platform-Module-nova/nova/virt/libvirt/blockinfo.py/has_disk_dev