nm: Fix error when modify port list of down interface
When modifying port list of the controller interface in `state: down`, nmstate forgot to detach saved inactive NM connection from this controller causing verification error on port list. To fix the issue, this patch introduced `detach_saved_nm_conn_from_controller()` to detach saved inactive NM connection from controller interface which has port list desired. For OVS bridge, will delete orphan OVS port and internal interface. Another approach to fix this issue is update query support in NM for showing `state:down` virtual interfaces from saved NmConnection, then existing code is enough to handle changed ports. This patch does not take that approach because: ``` Much bigger code changes are required to query `state: down` virtual interface from saved NmConnection which does not exist before. Currently, nmstate does not show `state:down` virtual interface, if we are showing them, we need to make sure all properties are actuate which is overkill for this corner case. ``` Integration test cases included for bond, ovs bridge and linux bridge. Resolves: https://issues.redhat.com/browse/RHEL-52334 Signed-off-by: Gris Ge <fge@redhat.com>
G
Gris Ge committed
521465eb07764c18311a206e7cc6b48e57802d6a
Parent: 01002ca