summaryrefslogtreecommitdiff
AgeCommit message (Collapse)AuthorFilesLines
2019-03-27ovs-interface: dissociate the link on disconnectionlr/ovs-interface-plinkLubomir Rintel1-0/+11
Open vSwitch is the special kid on the block -- it likes to be in charge of the link lifetime and so we shouldn't be. This means that we shouldn't be attempting to remove the link: we'd just (gracefully) fail anyways. More importantly, this also means that we shouldn't care if we see the link go away. Once the device reaches DISCONNECTED state, its configuration is cleaned up and we may already be activating another connection. We shouldn't alter the device state when OpenVSwitch decides to drop the old link. https://bugzilla.redhat.com/show_bug.cgi?id=1543557
2019-03-26device: fix the slave state change reason on master connection removalLubomir Rintel1-0/+5
If we surprise-remove the master, slaves would immediately attempt to bring things up by autoconnecting. Not cool. Policy, however, blocks autoconnect if the slaves disconnect due to "dependency-failed", and it indeed seems to be an appropriate reason here: $ nmcli c add type bridge $ nmcli c add type dummy ifname dummy0 master bridge autoconnect yes $ nmcli c del bridge $ Before: (nm-bridge): state change: ip-config -> deactivating (reason 'connection-removed') (nm-bridge): state change: deactivating -> disconnected (reason 'connection-removed') (nm-bridge): detached bridge port dummy0 (dummy0): state change: activated -> disconnected (reason 'connection-removed') (nm-bridge): state change: disconnected -> unmanaged (reason 'user-requested') (dummy0): state change: disconnected -> unmanaged (reason 'user-requested') policy: auto-activating connection 'bridge-slave-dummy0' After: (nm-bridge): state change: ip-config -> deactivating (reason 'connection-removed') (nm-bridge): state change: deactivating -> disconnected (reason 'connection-removed') (nm-bridge): detached bridge port dummy0 (dummy0): state change: activated -> deactivating (reason 'dependency-failed') (nm-bridge): state change: disconnected -> unmanaged (reason 'user-requested') (dummy0): state change: deactivating -> disconnected (reason 'dependency-failed') (dummy0): state change: disconnected -> unmanaged (reason 'user-requested') https://github.com/NetworkManager/NetworkManager/pull/319
2019-03-25nmcli: merge branch 'th/nmcli-list-options'Thomas Haller28-2685/+2248
https://github.com/NetworkManager/NetworkManager/pull/317
2019-03-25cli/trivial: add comment about partially modifying settings when failing ↵Thomas Haller1-0/+11
set_fcn()
2019-03-25cli: freeze/thaw property changed signals in nmc_setting_set_property()Thomas Haller1-7/+11
Setting one property might affect multiple properties. For example, setting a team property might also emit property changed signal for "team.config". Or, one property might be modified multiple times. For example list properties may first clear the property, then append multiple elements. Or a list property might remove multiple elements. Combine these signals via g_object_freeze_notify() and g_object_thaw_notify().
2019-03-25cli/trivial: add FIXME comment about how wrong ↵Thomas Haller2-0/+23
editor_init_existing_connection() is
2019-03-25cli: workaround libnm issue for setting team.runner-tx-hashThomas Haller1-2/+82
This workaround was dropped when refactoring the property handling. Restore the workaround (at least) until libnm is fixed.
2019-03-25nmcli: add clear_all_fcn() hook for mutllist property typesThomas Haller2-4/+14
2019-03-25cli: consistently validate multilist options for add and removeThomas Haller2-31/+14
There is no reason to validate only in certain cases. Either we validate, or we don't (always the same). This is a change in behavior, but the cases should be sensible.
2019-03-25cli: distinguish between resetting GObject property to default and NULLThomas Haller1-5/+14
Most GObject properties default to FALSE/NULL/0. In that case, there is no difference between setting the default or clearing the value. During if (_SET_FCN_DO_RESET_DEFAULT (property_info, modifier, value)) return _gobject_property_reset_default (setting, property_info->property_name); it is correct to reset the default. However for list-typed properties, we want to clear the list. So, it should be if (_SET_FCN_DO_SET_ALL (modifier, value)) _gobject_property_reset (setting, property_info->property_name, FALSE);
2019-03-25cli: accept ',' as delimiter for match.interface-namesThomas Haller1-3/+11
"match.interface-names" is the only property that uses VALUE_STRSPLIT_MODE_MULTILIST_WITH_ESCAPE. $ nmcli connection modify "$PROFILE" match.interface-name ' 5, \,\ 4\, ' results in [match] interface-name=5;, ;4,; and $ echo ">$(nmcli -g match.interface-name -escape=no connection show "$PROFILE")<" >5 \,\ 4\,< Yes, plain --get leads to a wrong double-escaping: $ echo ">$(nmcli -g match.interface-name connection show "$PROFILE")<" >5 \\,\\ 4\\,<
2019-03-25cli: don't support removing sriov vfs by indexThomas Haller2-4/+1
The VFs already can be parsed as plain number (to indicate the ifindex). We should not also support accepting the plain number as index to be removed. Fixes: a2f12994b7cd ('cli: add support for configuring SR-IOV')
2019-03-25shared: add _nm_utils_escape_plain() APIThomas Haller2-12/+40
2019-03-25all: consider all ASCII spaces for _nm_utils_escape_spaces() and unescapeThomas Haller1-9/+5
2019-03-25shared: add NM_ASCII_SPACES macroThomas Haller2-0/+27
2019-03-25cli: support list of indexes for removing objlist propertyThomas Haller1-14/+116
$ nmcli connection modify "$PROFILE" -ipv4.addresses 1,3 Already before, nmcli would support removing items by index. But only one number was supported. - indexes are zero based (as before). - duplicate indexes or indexes out of bounds are silently ignored. Maybe certain properties should not support removal by index.
2019-03-25cli: cleanup parsing of VLAN ingress/egress priority mapThomas Haller1-43/+20
Use new ValueStrsplitMode "VALUE_STRSPLIT_MODE_STRIPPED". Note that this is not exactly what we did before. For example, empty tokens are now silently removed. Also, we accept now whitespace as separators.
2019-03-25cli: refactor splitting the string when parsing the property valuesThomas Haller1-41/+84
Have one function that gets all the nonesense right. "nonesense", because we have inconsistent behaviors, and the function is supposed to help with that.
2019-03-25cli: merge remove-by-value and add functions of objlist property typesThomas Haller2-181/+70
2019-03-25cli: merge set_fcn() and remove_fcn()Thomas Haller3-244/+218
set_fcn() and remove_fcn() are strongly related. They should accept arguments in the same format, hence the parsing of the arguments should be done at one place. In fact, previously the parsing was separate, leading to ugly inconsistencies: $ nmcli connection modify "$PROFILE" +vpn.data x=y $ nmcli connection modify "$PROFILE" -vpn.data x=y Error: failed to remove a value from vpn.data: invalid option 'x=y'. or $ nmcli connection modify "$PROFILE" +ipv4.addresses 192.168.1.5/24,192.168.2.5/24 $ nmcli connection modify "$PROFILE" -ipv4.addresses 192.168.1.5/24,192.168.2.5/24 Error: failed to remove a value from ipv4.addresses: invalid prefix '24,192.168.2.5/24'; <1-32> allowed. Let set_fcn() handle set-default, set-all, add, and subtract.
2019-03-25cli: allow resetting all values via set_fcn() property handlerThomas Haller3-147/+155
Previously, set_fcn() could only append values. Now, pass on the modifier so that it may append, set all, or reset the default. These operations are strongly related and should be handled by the same set_fcn() function.
2019-03-25cli: implement remove-fcn for objlist typesThomas Haller2-139/+96
2019-03-25cli: implement add-fcn for objlist typesThomas Haller2-132/+105
2019-03-25cli: add clear-all-fcn for objlist propertiesThomas Haller2-1/+17
2019-03-25cli: add objlist property type and implement get_fcn() for all typesThomas Haller2-218/+211
2019-03-25cli: implement team:runner-tx-hash as multilist propertyThomas Haller3-98/+39
2019-03-25cli: implement match:interface-names as multilist propertyThomas Haller2-31/+32
2019-03-25shared: add "strip" argument to _nm_utils_unescape_spaces()Thomas Haller5-21/+86
It's usually not necessary, because _nm_utils_unescape_spaces() gets called after nm_utils_strsplit_set(), which already removes the non-escaped spaces. Still, for completeness, this should be here. Also, because with this the function is useful for individual options (not delimiter separate list values), to support automatically dropping leading or trailing whitespace, but also support escaping them.
2019-03-25cli: implement connection:permissions as multilist propertyThomas Haller3-71/+47
2019-03-25cli: minor cleanup of _get_fcn_connection_permissions()Thomas Haller1-11/+13
2019-03-25cli: implement connection:secondaries as multilist propertyThomas Haller1-39/+20
2019-03-25cli: implement mac-address-blacklist properties as mulitlist typesThomas Haller1-79/+27
2019-03-25cli: first validate all values in _set_fcn_multilist() before modifying the ↵Thomas Haller1-2/+8
setting
2019-03-25cli: implement DNS property as multilist typeThomas Haller2-54/+36
2019-03-25cli: support validating multilist entries for remove-by-valueThomas Haller2-19/+44
2019-03-25cli: implement DNS option property as multilist typeThomas Haller1-28/+20
2019-03-25cli: make get_with_default property-type-data generally availableThomas Haller2-52/+38
A property-info can only have one property-typ-data. That means, all functions (get_fcn(), set_fcn()) need to either take not property-typ-data, or they must all accept the same. That made it hard to mix _get_fcn_nmc_with_default() with setters that do require a certain property-typ-data. Instead, move the is_default_func() to the general portion, and let _get_fcn_gobject() handle it.
2019-03-25cli: implement DNS search property as multilist typeThomas Haller2-58/+60
2019-03-25cli: add property type for 802-1x certificate properties (pt5)Thomas Haller1-66/+3
2019-03-25cli: add property type for 802-1x certificate properties (pt4)Thomas Haller1-33/+4
2019-03-25cli: add property type for 802-1x certificate properties (pt3)Thomas Haller1-10/+34
2019-03-25cli: add property type for 802-1x certificate properties (pt2)Thomas Haller1-125/+15
2019-03-25cli: add property type for 802-1x certificate properties (pt1)Thomas Haller2-10/+45
2019-03-25shared: add set function to nm_setting_8021x_scheme_vtableThomas Haller2-0/+20
2019-03-25cli: merge mac_address_blacklist settersThomas Haller1-34/+35
2019-03-25cli: implement NM_SETTING_WIRED_S390_OPTIONS with the optionlist setterThomas Haller1-67/+15
2019-03-25libnm: don't assert for valid string length in ↵Thomas Haller1-6/+1
nm_setting_wired_add_s390_option() The setting's verify() function already checks that the s390 options are not empty and no longer than 200. Asserting for that is a major annoyance, because callers need to reimplement that check.
2019-03-25cli: implement NM_SETTING_VPN_SECRETS with the optionlist setterThomas Haller1-20/+5
2019-03-25cli: implement NM_SETTING_VPN_DATA with the optionlist setterThomas Haller2-14/+38
2019-03-25cli: add optionlist setter for bond optionsThomas Haller2-25/+87