def _check_preferred_compat_mode(preferred_mode, supported_modes):
    """Checks whether the LPAR's preferred mode is supported

       :param preferred_mode: preferred compat mode of the LPAR
       :param supported_modes: proc compat modes supported by the dest host
       :returns: True if the preferred mode is supported and False otherwise
    """

    if preferred_mode == 'default':
        return True
    return preferred_mode in supported_modes