def __get_os_qos(cinder, qos_name=None, qos_settings=None):
    """
    Returns an OpenStack QoS object for a given name
    :param cinder: the Cinder client
    :param qos_name: the qos name to lookup
    :param qos_settings: the qos settings used for lookups
    :return: the qos object or None
    """
    if not qos_name and not qos_settings:
        return None

    if qos_settings:
        qos_name = qos_settings.name

    qoss = cinder.qos_specs.list()
    for qos in qoss:
        if qos.name == qos_name:
            return qos