def match_config(filters, device, kind, default):
    """
    Matches devices against multiple :class:`DeviceFilter`s.

    :param list filters: device filters
    :param Device device: device to be mounted
    :param str kind: value kind
    :param default: default value
    :returns: value of the first matching filter
    """
    while device is not None:
        for f in filters:
            if f.has_value(kind) and f.match(device):
                return f.value(kind, device)
            if f.has_value('skip') and f.match(device) and f.value('skip',
                device) in (True, 'all', kind):
                break
        device = device.partition_slave or device.luks_cleartext_slave
    return default
