summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJiri Popelka <jpopelka@redhat.com>2011-10-07 15:58:06 +0200
committerDan Williams <dcbw@redhat.com>2011-11-09 21:40:13 -0600
commit3e11682ddc69037a06a9bd70abf2739eb43e9876 (patch)
tree2b22cb22ef0b299f61d40ad13ad9400de024d9e8
parent04c8ec7360b32d8b52bbd81664e05584c2bbe301 (diff)
ifcfg-rh: read/write zone name from/to ZONE key
-rw-r--r--src/settings/plugins/ifcfg-rh/reader.c12
-rw-r--r--src/settings/plugins/ifcfg-rh/writer.c2
2 files changed, 13 insertions, 1 deletions
diff --git a/src/settings/plugins/ifcfg-rh/reader.c b/src/settings/plugins/ifcfg-rh/reader.c
index 910cca3581..e503cd2e18 100644
--- a/src/settings/plugins/ifcfg-rh/reader.c
+++ b/src/settings/plugins/ifcfg-rh/reader.c
@@ -85,7 +85,7 @@ make_connection_setting (const char *file,
{
NMSettingConnection *s_con;
const char *ifcfg_name = NULL;
- char *new_id = NULL, *uuid = NULL, *value;
+ char *new_id = NULL, *uuid = NULL, *zone = NULL, *value;
char *ifcfg_id;
ifcfg_name = utils_get_ifcfg_name (file, TRUE);
@@ -127,6 +127,7 @@ make_connection_setting (const char *file,
g_free (uuid);
uuid = nm_utils_uuid_generate_from_string (ifcfg->fileName);
}
+
g_object_set (s_con,
NM_SETTING_CONNECTION_TYPE, type,
NM_SETTING_CONNECTION_UUID, uuid,
@@ -153,6 +154,15 @@ make_connection_setting (const char *file,
g_strfreev (items);
}
+
+ zone = svGetValue(ifcfg, "ZONE", FALSE);
+ if (!zone || !strlen (zone)) {
+ g_free (zone);
+ zone = NULL;
+ }
+ g_object_set (s_con, NM_SETTING_CONNECTION_ZONE, zone, NULL);
+ g_free (zone);
+
return NM_SETTING (s_con);
}
diff --git a/src/settings/plugins/ifcfg-rh/writer.c b/src/settings/plugins/ifcfg-rh/writer.c
index 068bcda258..b6f89aa291 100644
--- a/src/settings/plugins/ifcfg-rh/writer.c
+++ b/src/settings/plugins/ifcfg-rh/writer.c
@@ -1097,6 +1097,8 @@ write_connection_setting (NMSettingConnection *s_con, shvarFile *ifcfg)
svSetValue (ifcfg, "USERS", str->str, FALSE);
g_string_free (str, TRUE);
}
+
+ svSetValue (ifcfg, "ZONE", nm_setting_connection_get_zone(s_con), FALSE);
}
static gboolean