@@ -82,124 +82,6 @@ netplan_clear_netdefs()
8282 netplan_parser_reset (& global_parser );
8383 return n ;
8484}
85-
86- // LCOV_EXCL_START
87- NETPLAN_INTERNAL void
88- write_network_file (const NetplanNetDefinition * def , const char * rootdir , const char * path )
89- {
90- GError * error = NULL ;
91- if (!netplan_netdef_write_network_file (& global_state , def , rootdir , path , NULL , & error ))
92- {
93- g_fprintf (stderr , "%s" , error -> message );
94- exit (1 );
95- }
96- }
97-
98- /**
99- * Generate networkd configuration in @rootdir/run/systemd/network/ from the
100- * parsed #netdefs.
101- * @rootdir: If not %NULL, generate configuration in this root directory
102- * (useful for testing).
103- * Returns: TRUE if @def applies to networkd, FALSE otherwise.
104- */
105- gboolean
106- write_networkd_conf (const NetplanNetDefinition * def , const char * rootdir )
107- {
108- GError * error = NULL ;
109- gboolean has_been_written ;
110- if (!netplan_netdef_write_networkd (& global_state , def , rootdir , & has_been_written , & error ))
111- {
112- g_fprintf (stderr , "%s" , error -> message );
113- exit (1 );
114- }
115- return has_been_written ;
116- }
117-
118- NETPLAN_INTERNAL void
119- cleanup_networkd_conf (const char * rootdir )
120- {
121- netplan_networkd_cleanup (rootdir );
122- }
123-
124- // There only for compatibility purposes, the proper implementation is now directly
125- // in the `generate` binary.
126- NETPLAN_ABI void
127- enable_networkd (const char * generator_dir )
128- {
129- g_autofree char * link = g_build_path (G_DIR_SEPARATOR_S , generator_dir , "multi-user.target.wants" , "systemd-networkd.service" , NULL );
130- g_debug ("We created networkd configuration, adding %s enablement symlink" , link );
131- safe_mkdir_p_dir (link );
132- if (symlink ("../systemd-networkd.service" , link ) < 0 && errno != EEXIST ) {
133- g_fprintf (stderr , "failed to create enablement symlink: %m\n" );
134- exit (1 );
135- }
136-
137- g_autofree char * link2 = g_build_path (G_DIR_SEPARATOR_S , generator_dir , "network-online.target.wants" , "systemd-networkd-wait-online.service" , NULL );
138- safe_mkdir_p_dir (link2 );
139- if (symlink ("/lib/systemd/system/systemd-networkd-wait-online.service" , link2 ) < 0 && errno != EEXIST ) {
140- g_fprintf (stderr , "failed to create enablement symlink: %m\n" );
141- exit (1 );
142- }
143- }
144-
145- NETPLAN_INTERNAL void
146- write_nm_conf (NetplanNetDefinition * def , const char * rootdir )
147- {
148- GError * error = NULL ;
149- if (!netplan_netdef_write_nm (& global_state , def , rootdir , NULL , & error )) {
150- g_fprintf (stderr , "%s" , error -> message );
151- exit (1 );
152- }
153- }
154-
155- NETPLAN_INTERNAL void
156- write_nm_conf_finish (const char * rootdir )
157- {
158- /* Original implementation had no error possible!! */
159- g_assert (netplan_state_finish_nm_write (& global_state , rootdir , NULL ));
160- }
161-
162- NETPLAN_INTERNAL void
163- cleanup_nm_conf (const char * rootdir )
164- {
165- netplan_nm_cleanup (rootdir );
166- }
167-
168- NETPLAN_INTERNAL void
169- write_ovs_conf (const NetplanNetDefinition * def , const char * rootdir )
170- {
171- GError * error = NULL ;
172- if (!netplan_netdef_write_ovs (& global_state , def , rootdir , NULL , & error )) {
173- g_fprintf (stderr , "%s" , error -> message );
174- exit (1 );
175- }
176- }
177-
178- NETPLAN_INTERNAL void
179- write_ovs_conf_finish (const char * rootdir )
180- {
181- /* Original implementation had no error possible!! */
182- g_assert (netplan_state_finish_ovs_write (& global_state , rootdir , NULL ));
183- }
184-
185- NETPLAN_INTERNAL void
186- cleanup_ovs_conf (const char * rootdir )
187- {
188- netplan_ovs_cleanup (rootdir );
189- }
190-
191- NETPLAN_INTERNAL void
192- write_sriov_conf_finish (const char * rootdir )
193- {
194- /* Original implementation had no error possible!! */
195- g_assert (netplan_state_finish_sriov_write (& global_state , rootdir , NULL ));
196- }
197-
198- NETPLAN_INTERNAL void
199- cleanup_sriov_conf (const char * rootdir )
200- {
201- netplan_sriov_cleanup (rootdir );
202- }
20385// LCOV_EXCL_STOP
20486
20587gboolean
0 commit comments