def METHOD_NAME(block_name):
    blocks_info = monitor.info("block")
    if isinstance(blocks_info, six.string_types):
        lock_str = "locked=1"
        for block in blocks_info.splitlines():
            if block_name in block and lock_str in block:
                return True
    else:
        for block in blocks_info:
            if vm.check_capability(Flags.BLOCKDEV):
                condition = block['qdev'] == vm.devices.get_qdev_by_drive(block_name)
            else:
                condition = block['device'] == block_name
            if condition and block['locked']:
                return True
    return False