libnm: change default value for "dcb.app-fcoe-mode" property

String properties in libnm's NMSetting really should have NULL as a
default value. The only property that didn't, was "dcb.app-fcoe-mode".

Change the default so that it is also NULL.

Changing a default value is an API change, but in this case probably no
issue. For one, DCB is little used. But also, it's not clear who would
care and notice the change. Also, because previously verify() would reject
a NULL value as invalid. That means, there are no existing, valid profiles
that have this value set to NULL.  We just make NULL the default, and
define that it means the same as "fabric".

Note that when we convert integer properties to D-Bus/GVariant, we often
omit the default value. For string properties, they are serialized as
"s" variant type. As such, NULL cannot be expressed as "s" type, so we
represent NULL by omitting the property. That makes especially sense if
the default value is also NULL. Otherwise, it's rather odd. We change
that, and we will now always express non-NULL value on D-Bus and let
NULL be encoded by omitting the property.
This commit is contained in:
Thomas Haller
2021-10-25 10:45:03 +02:00
parent 38d81cfa89
commit aeb2426e88
6 changed files with 20 additions and 32 deletions

View File

@@ -430,7 +430,7 @@
<property name="app-fcoe-priority"
description="The highest User Priority (0 - 7) which FCoE frames should use, or -1 for default priority. Only used when the &quot;app-fcoe-flags&quot; property includes the NM_SETTING_DCB_FLAG_ENABLE (0x1) flag." />
<property name="app-fcoe-mode"
description="The FCoE controller mode; either &quot;fabric&quot; (default) or &quot;vn2vn&quot;." />
description="The FCoE controller mode; either &quot;fabric&quot; or &quot;vn2vn&quot;. Since 1.34, NULL is the default and means &quot;fabric&quot;. Before 1.34, NULL was rejected as invalid and the default was &quot;fabric&quot;." />
<property name="app-iscsi-flags"
description="Specifies the NMSettingDcbFlags for the DCB iSCSI application. Flags may be any combination of NM_SETTING_DCB_FLAG_ENABLE (0x1), NM_SETTING_DCB_FLAG_ADVERTISE (0x2), and NM_SETTING_DCB_FLAG_WILLING (0x4)." />
<property name="app-iscsi-priority"