core: add FIXME(release-blocker) comments for match.kernel-command-line behavior

https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/431#note_490830
This commit is contained in:
Thomas Haller 2020-05-12 09:35:08 +02:00
parent 755c3af915
commit b7a2e73bd2
No known key found for this signature in database
GPG key ID: 29C2366E4DFC5728
2 changed files with 23 additions and 1 deletions

View file

@ -6099,6 +6099,28 @@ check_connection_compatible (NMDevice *self, NMConnection *connection, GError **
proc_cmdline_i++;
}
/* FIXME(release-blocker): match.interface-name and match.driver have the meaning,
* that any of the matches may yield success. For match.kernel-command-line, we
* do here that all must match. This inconsistency is undesired.
*
* 1) improve gtk-doc documentation explaining how these options match.
*
* 2) possibly unify the behavior so that kernel-command-line behaves like other
* matches (and ANY may match). Note that this would be contrary to systemd's
* Conditions, which by default requires that ALL conditions match (AND). We
* should be consistent within our match options, and not with systemd here.
*
* 2b) Note that systemd supports special token like "=|", to indicate that
* ANY behavior. If we want, we could also introduce two special prefixes
* "&..." and "|...", to support either. It's slightly complicated how
* these work in combinations with "!".
* Unless we fully decide what we do about this, NMSettingMatch.verify() should
* reject matches that start with '&' or '|', because these will be reserved for
* future use.
*
* 3) while fixing this, this code should move to a separate function so we
* can unit test the match of kernel command lines.
*/
if ( pos_patterns
&& !found) {
/* positive patterns configured but no match */

View file

@ -2780,7 +2780,7 @@ again:
if (G_UNLIKELY (!proc_cmdline)) {
gs_free const char **split = NULL;
/* TODO: support quotation, like systemd's proc_cmdline_extract_first().
/* FIXME(release-blocker): support quotation, like systemd's proc_cmdline_extract_first().
* For that, add a new NMUtilsStrsplitSetFlags flag. */
split = nm_utils_strsplit_set_full (nm_utils_proc_cmdline (),
NM_ASCII_WHITESPACES,