device/trivial: add comment about lifetime of "kind" in tc_commit()

In general, all fields of public NMPlatform* structs must be
plain/simple. Meaning: copying the struct must be possible without
caring about cloning/duplicating memory.
In other words, if there are fields which lifetime is limited,
then these fields cannot be inside the public part NMPlatform*.

That is why

  - "NMPlatformLink.kind", "NMPlatformQdisc.kind", "NMPlatformTfilter.kind"
    are set by platform code to an interned string (g_intern_string())
    that has a static lifetime.

  - the "ingress_qos_map" field is inside the ref-counted struct NMPObjectLnkVlan
    and not NMPlatformLnkVlan. This field requires managing the lifetime
    of the array and NMPlatformLnkVlan cannot provide that.

See also for example NMPClass.cmd_obj_copy() which can deep-copy an object.
But this is only suitable for fields in NMPObject*. The purpose of this
rule is that you always can safely copy a NMPlatform* struct without
worrying about the ownership and lifetime of the fields (the field's
lifetime is unlimited).

This rule and managing of resource lifetime is the main reason for the
NMPlatform*/NMPObject* split. NMPlatform* structs simply have no mechanism
for copying/releasing fields, that is why the NMPObject* counterpart exists
(which is ref-counted and has a copy and destructor function).

This is violated in tc_commit() for the "kind" strings. The lifetime
of these strings is tied to the setting instance.

We cannot intern the strings (because these are arbitrary strings
and interned strings are leaked indefinitely). We also cannot g_strdup()
the strings, because NMPlatform* is not supposed to own strings.

So, just add comments that warn about this ugliness.

The more correct solution would be to move the "kind" fields inside
NMPObjectQdisc and NMPObjectTfilter, but that is a lot of extra effort.
12 jobs for th/various-cleanup-platform-libnm in 26 minutes and 29 seconds (queued for 1 second)
Status Job ID Name Coverage
  Test
passed #287087
allowed to fail
checkpatch

00:01:10

passed #287094
t_debian:9

00:19:37

passed #287096
t_debian:sid

00:20:01

manual #287095
allowed to fail manual
t_debian:testing
passed #287088
t_fedora:28

00:18:58

passed #287089
t_fedora:29

00:26:27

passed #287090
t_fedora:30

00:25:32

manual #287091
allowed to fail manual
t_fedora:rawhide
passed #287092
t_ubuntu:16.04

00:19:33

passed #287093
t_ubuntu:18.04

00:19:53

 
  External
failed NetworkManager test verification

failed NetworkManager test verification

05:58:25