diff options
| author | Michael Biebl <biebl@debian.org> | 2019-04-21 21:09:51 +0200 |
|---|---|---|
| committer | Michael Biebl <biebl@debian.org> | 2019-04-21 21:09:51 +0200 |
| commit | 85563b7fc7ec2cd21e38debb9b28db342e2e8e7c (patch) | |
| tree | cce7b0b02d28fae2df9fdf2c1804cacd1500f2d7 /src/settings/plugins/ibft/nms-ibft-plugin.c | |
| parent | 9a6dcbf895f9da01768e64b73cec88c16157d91e (diff) | |
New upstream version 1.18.0 upstream/1.18.0
Diffstat (limited to 'src/settings/plugins/ibft/nms-ibft-plugin.c')
| -rw-r--r-- | src/settings/plugins/ibft/nms-ibft-plugin.c | 23 |
1 files changed, 11 insertions, 12 deletions
diff --git a/src/settings/plugins/ibft/nms-ibft-plugin.c b/src/settings/plugins/ibft/nms-ibft-plugin.c index 00b25068..47051995 100644 --- a/src/settings/plugins/ibft/nms-ibft-plugin.c +++ b/src/settings/plugins/ibft/nms-ibft-plugin.c @@ -64,31 +64,30 @@ static void read_connections (NMSIbftPlugin *self) { NMSIbftPluginPrivate *priv = NMS_IBFT_PLUGIN_GET_PRIVATE (self); - GSList *blocks = NULL, *iter; - GError *error = NULL; + nm_auto_free_ibft_blocks GSList *blocks = NULL; + GSList *iter; + gs_free_error GError *error = NULL; NMSIbftConnection *connection; if (!nms_ibft_reader_load_blocks ("/sbin/iscsiadm", &blocks, &error)) { nm_log_dbg (LOGD_SETTINGS, "ibft: failed to read iscsiadm records: %s", error->message); - g_error_free (error); return; } for (iter = blocks; iter; iter = iter->next) { connection = nms_ibft_connection_new (iter->data, &error); - if (connection) { - nm_log_info (LOGD_SETTINGS, "ibft: read connection '%s'", - nm_settings_connection_get_id (NM_SETTINGS_CONNECTION (connection))); - g_hash_table_insert (priv->connections, - g_strdup (nm_settings_connection_get_uuid (NM_SETTINGS_CONNECTION (connection))), - connection); - } else { + if (!connection) { nm_log_warn (LOGD_SETTINGS, "ibft: failed to read iscsiadm record: %s", error->message); g_clear_error (&error); + continue; } - } - g_slist_free_full (blocks, (GDestroyNotify) g_ptr_array_unref); + nm_log_info (LOGD_SETTINGS, "ibft: read connection '%s'", + nm_settings_connection_get_id (NM_SETTINGS_CONNECTION (connection))); + g_hash_table_insert (priv->connections, + g_strdup (nm_settings_connection_get_uuid (NM_SETTINGS_CONNECTION (connection))), + connection); + } } static GSList * |