netplan:slyon/clear-virtual-interfaces-lp1943120

Last commit made on 2021-09-27
Get this branch:
git clone -b slyon/clear-virtual-interfaces-lp1943120 https://git.launchpad.net/netplan

Branch merges

Branch information

Name:
slyon/clear-virtual-interfaces-lp1943120
Repository:
lp:netplan

Recent commits

9a3cf62... by Lukas Märdian

cli:apply:clear_virtual_links: make devices a named parameter

3f859f0... by Lukas Märdian

dbus: properly create and clean the backup state dir

ccd2bb2... by Lukas Märdian

dbus: make use of new YAML state tracking

92fd993... by Lukas Märdian

cli:try: use clear_virtual_links from Apply()

89cc7b0... by Lukas Märdian

doc:apply: update manpage

32e320a... by Lukas Märdian

tests:scenarios: check virtual interface cleanup

d351061... by Lukas Märdian

cli:apply:configmanager: clear_virtual_links during apply

17d3848... by Lukas Märdian

parse: add 'default-routes' feature-flag

As suggested by rahaper in https://github.com/canonical/netplan/pull/216

73d4024... by Simon Chopin <email address hidden>

NetDefinition: ownership and cleanup (FR-786) (#228)

This PR is mostly about cleaning up the NetplanNetDefinition objects, and when to do it. There are a couple of precursor commits that either made the transition easier or fixed some bugs that were uncovered when actually trying to clean up things ;).

There are no API or ABI change, although there's one observable change with the dhcp_identifier which now defaults to NULL instead of an owned string "duid". The rationales are in the commit that makes the change.

As usual, each commit log contains some context information related to each change, and the commits are split up with the explicit intent of making it easier to review, one commit at a time.

COMMITS:
* lib: parse-nm: clarify ownership of the backend-settings strings
Some of the strings that were stored in the generated backend settings
had unclear ownership, leading to either leaks, double-free, or dangling
pointers. This patch forces the duplication in order to simplify
handling afterwards, and documents some assumptions that aren't shown
through the typesystem (I'm looking at you, GData *).

* lib: use NULL for the dhcp_identifier default case
This centralizes the place where we know about "duid", and makes my life
easier when writing reset/freeing code for netdef as I don't have to
reallocate a string after I've cleared them all.

* lib: helper functions to reset some internal data structures
Those functions do a full in-depth cleaning and reset each value to its
default.
I chose to put them in a separate source file as I feel we're getting
away from the notion of parsing and much more into the object management
after its creation. In all honesty, if the netplan_netdef_new function
didn't reference a static data structure, I would have moved it into the
new module as well (and probably will in my later API-breaking patchset,
but that's a story for another time).

* lib: clarify the ownership of the netdef objects
With this patch, we now decide arbitrarily that the owner of the netdef
objects is the netdef_ordered list, and all other pointers are weak
references. Knowing this, we can now easily clean up all netdefs.
Since _ordered is the owner of the global netdefs, it doesn't make sense
to change the cur_netdef reference before the new object is in the
global array, which is why we do the netdef initialization on a
local-only object, which we hand over only after it has been registered
in _ordered.

d4884cf... by ncc <email address hidden>

Add support for networkd ConfigureWithoutCarrier (ignore-carrier) option on interfaces (#215)

The ConfigureWithoutCarrier networkd option allows networkd to configure a specific link even if it has no carrier. This is useful for services such as isc-dhcp-server, which requires that all managed interfaces are up and assigned IP addresses regardless of their physical status.

I chose to put this key under COMMON_LINK_HANDLERS rather than PHYSICAL_LINK_HANDLERS as networkd does not differentiate between physical and virtual links WRT the ConfigureWithoutCarrier option, as far as I can tell.

COMMITS:
* Add support for networkd ConfigureWithoutCarrier option on physical links
* move gboolean definition to new section in src/parse.h
* move configure_without_carrier to end of net_definition struct; update documentation phrasing; add test coverage
* remove extra blank line
* update ignore-carrier wording
* test:common: fixup merging of gateway tests

Co-authored-by: Lukas Märdian <email address hidden>