def update_qos_filter(self, context, id, qos_filter):
        qos_filter = qos_filter['qos_filter']
        new_prio = qos_filter.get('prio', None)

        with context.session.begin(subtransactions=True):
            qos_filter_db = self._get_qos_filter(context, id)
            if qos_filter.get('queue_id', None) is not None:
                qos_queue_db = self._get_qos_queue(context,
                                                   qos_filter['queue_id'])
                self._check_queue_in_qos(qos_filter_db.qos_id, qos_queue_db)
                if qos_queue_db.subqueues:
                    raise ext_qos.QosQueueHasSub(qos_queue_id=qos_queue_db.id)
            if new_prio is not None and new_prio != qos_filter_db.prio:
                if self._same_prio_filter_in_qos(qos_filter_db.qos, new_prio):
                    raise ext_qos.QosDuplicateFilterPrioValue(prio=new_prio)
            qos_filter_db.update(qos_filter)
        return self._make_qos_filter_dict(qos_filter_db)