Merge ~slyon/snappy-hwe-snaps/+git/network-manager:slyon/netplan-0104-compat into ~snappy-hwe-team/snappy-hwe-snaps/+git/network-manager:snap-20

Proposed by Lukas Märdian
Status: Merged
Approved by: Alfonso Sanchez-Beato
Approved revision: e8ed6a5822a90e6b8f241552df601285b8532f6f
Merged at revision: e76d7340d1e2e0433f98e3efe8883085be929a5e
Proposed branch: ~slyon/snappy-hwe-snaps/+git/network-manager:slyon/netplan-0104-compat
Merge into: ~snappy-hwe-team/snappy-hwe-snaps/+git/network-manager:snap-20
Diff against target: 35 lines (+3/-3)
1 file modified
snap-patch/networkmanager/0002-nm-netplan-keyfile.patch (+3/-3)
Reviewer Review Type Date Requested Status
System Enablement Bot continuous-integration Approve
Alfonso Sanchez-Beato Approve
Review via email: mp+415663@code.launchpad.net

Commit message

Update netplan integration for v0.104 compatibility

netplan_clear_netdefs() is being called to early, therefore netdef_id is
undefined/garbage and can not be used to calculate a path.

This did work in netplan <= 0.103 as there was a memory leak and netdef_id
was not actually cleared, starting with 0.104 the memory leak is fixed and
we need to adopt the NetworkManager integration accordingly.

This change is compatible with old and new versions of libnetplan.

Description of the change

Update netplan integration for v0.104 compatibility

netplan_clear_netdefs() is being called to early, therefore netdef_id is
undefined/garbage and can not be used to calculate a path.

This did work in netplan <= 0.103 as there was a memory leak and netdef_id
was not actually cleared, starting with 0.104 the memory leak is fixed and
we need to adopt the NetworkManager integration accordingly.

This change is compatible with old and new versions of libnetplan.

To post a comment you must log in.
Revision history for this message
System Enablement Bot (system-enablement-ci-bot) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
Alfonso Sanchez-Beato (alfonsosanchezbeato) wrote :

LGTM, thanks! Let's way for the CI tests now, I have retriggered them.

review: Approve
Revision history for this message
System Enablement Bot (system-enablement-ci-bot) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
System Enablement Bot (system-enablement-ci-bot) wrote :
review: Approve (continuous-integration)

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1diff --git a/snap-patch/networkmanager/0002-nm-netplan-keyfile.patch b/snap-patch/networkmanager/0002-nm-netplan-keyfile.patch
2index 6dbaf2a..ad89e95 100644
3--- a/snap-patch/networkmanager/0002-nm-netplan-keyfile.patch
4+++ b/snap-patch/networkmanager/0002-nm-netplan-keyfile.patch
5@@ -1,4 +1,4 @@
6-From 58fd964ae79bfb635928b839f5788e1face8ddfb Mon Sep 17 00:00:00 2001
7+From 5ffe6c36ed2e9a5effc07d706f0b8dc34c7515ab Mon Sep 17 00:00:00 2001
8 From: Lukas Märdian <lukas.maerdian@canonical.com>
9 Date: Tue, 2 Feb 2021 15:52:05 +0100
10 Subject: [PATCH] netplan: make use of libnetplan for YAML backend
11@@ -249,7 +249,7 @@ index f943d65ca6834efd2bc243397d122243d906712e..4803135d3f60cdfae4a23640cefcbe6d
12 +
13 #endif /* __NMS_KEYFILE_UTILS_H__ */
14 diff --git a/src/settings/plugins/keyfile/nms-keyfile-writer.c b/src/settings/plugins/keyfile/nms-keyfile-writer.c
15-index fa95198c0084ac6b907f7ffa7ba826a1cca6a025..53d8f929921181adbe2b0349ee80d1b93939e829 100644
16+index fa95198c0084ac6b907f7ffa7ba826a1cca6a025..627c72d7a0ff76e9b00e0a5d6c19111583ba3d66 100644
17 --- a/src/settings/plugins/keyfile/nms-keyfile-writer.c
18 +++ b/src/settings/plugins/keyfile/nms-keyfile-writer.c
19 @@ -11,6 +11,10 @@
20@@ -294,7 +294,6 @@ index fa95198c0084ac6b907f7ffa7ba826a1cca6a025..53d8f929921181adbe2b0349ee80d1b9
21 + g_hash_table_iter_init (&iter, netdefs);
22 + g_hash_table_iter_next (&iter, &netdef_id, &netplan_connection); // get first (and only) netdef from map
23 + write_netplan_conf(netplan_connection, rootdir); // write netdef to YAML
24-+ netplan_clear_netdefs();
25 +
26 + /* Delete same connection-profile provided by legacy netplan plugin */
27 + g_autofree gchar* legacy_path = NULL;
28@@ -338,6 +337,7 @@ index fa95198c0084ac6b907f7ffa7ba826a1cca6a025..53d8f929921181adbe2b0349ee80d1b9
29 + rootdir ?: "", (char *)netdef_id);
30 + }
31 + }
32++ netplan_clear_netdefs();
33 +
34 + /* re-read again: this time the connection profile newly generated by netplan in /run/... */
35 + if ( out_reread

Subscribers

People subscribed via source and target branches