Commit 0b41797b authored by Dan Williams's avatar Dan Williams

s390: replace 'zvm' with s390

ZVM isn't the right terminology here.  s390 is.
parent a5d8872c
......@@ -289,7 +289,7 @@ global:
nm_setting_wired_get_auto_negotiate;
nm_setting_wired_get_mac_address;
nm_setting_wired_get_mtu;
nm_setting_wired_get_zvm_subchannels;
nm_setting_wired_get_s390_subchannels;
nm_setting_wireless_ap_security_compatible;
nm_setting_wireless_error_get_type;
nm_setting_wireless_error_quark;
......
......@@ -76,7 +76,7 @@ typedef struct {
gboolean auto_negotiate;
GByteArray *mac_address;
guint32 mtu;
GPtrArray *zvm_subchannels;
GPtrArray *s390_subchannels;
} NMSettingWiredPrivate;
enum {
......@@ -87,7 +87,7 @@ enum {
PROP_AUTO_NEGOTIATE,
PROP_MAC_ADDRESS,
PROP_MTU,
PROP_ZVM_SUBCHANNELS,
PROP_S390_SUBCHANNELS,
LAST_PROP
};
......@@ -147,11 +147,11 @@ nm_setting_wired_get_mtu (NMSettingWired *setting)
}
const GPtrArray *
nm_setting_wired_get_zvm_subchannels (NMSettingWired *setting)
nm_setting_wired_get_s390_subchannels (NMSettingWired *setting)
{
g_return_val_if_fail (NM_IS_SETTING_WIRED (setting), NULL);
return NM_SETTING_WIRED_GET_PRIVATE (setting)->zvm_subchannels;
return NM_SETTING_WIRED_GET_PRIVATE (setting)->s390_subchannels;
}
static gboolean
......@@ -185,11 +185,11 @@ verify (NMSetting *setting, GSList *all_settings, GError **error)
return FALSE;
}
if (priv->zvm_subchannels && priv->zvm_subchannels->len != 3) {
if (priv->s390_subchannels && priv->s390_subchannels->len != 3) {
g_set_error (error,
NM_SETTING_WIRED_ERROR,
NM_SETTING_WIRED_ERROR_INVALID_PROPERTY,
NM_SETTING_WIRED_ZVM_SUBCHANNELS);
NM_SETTING_WIRED_S390_SUBCHANNELS);
return FALSE;
}
......@@ -245,12 +245,12 @@ set_property (GObject *object, guint prop_id,
case PROP_MTU:
priv->mtu = g_value_get_uint (value);
break;
case PROP_ZVM_SUBCHANNELS:
if (priv->zvm_subchannels) {
g_ptr_array_foreach (priv->zvm_subchannels, (GFunc) g_free, NULL);
g_ptr_array_free (priv->zvm_subchannels, TRUE);
case PROP_S390_SUBCHANNELS:
if (priv->s390_subchannels) {
g_ptr_array_foreach (priv->s390_subchannels, (GFunc) g_free, NULL);
g_ptr_array_free (priv->s390_subchannels, TRUE);
}
priv->zvm_subchannels = g_value_dup_boxed (value);
priv->s390_subchannels = g_value_dup_boxed (value);
break;
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
......@@ -283,8 +283,8 @@ get_property (GObject *object, guint prop_id,
case PROP_MTU:
g_value_set_uint (value, nm_setting_wired_get_mtu (setting));
break;
case PROP_ZVM_SUBCHANNELS:
g_value_set_boxed (value, nm_setting_wired_get_zvm_subchannels (setting));
case PROP_S390_SUBCHANNELS:
g_value_set_boxed (value, nm_setting_wired_get_s390_subchannels (setting));
break;
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
......@@ -411,7 +411,7 @@ nm_setting_wired_class_init (NMSettingWiredClass *setting_class)
G_PARAM_READWRITE | G_PARAM_CONSTRUCT | NM_SETTING_PARAM_SERIALIZE | NM_SETTING_PARAM_FUZZY_IGNORE));
/**
* NMSettingWired:zvm-subchannels:
* NMSettingWired:s390-subchannels:
*
* Identifies specific subchannels that this network device uses for
* communcation with z/VM or s390 host. Like #NMSettingWired:mac-address
......@@ -421,8 +421,8 @@ nm_setting_wired_class_init (NMSettingWiredClass *setting_class)
* composed of hexadecimal characters and the period (.) character.
**/
g_object_class_install_property
(object_class, PROP_ZVM_SUBCHANNELS,
_nm_param_spec_specialized (NM_SETTING_WIRED_ZVM_SUBCHANNELS,
(object_class, PROP_S390_SUBCHANNELS,
_nm_param_spec_specialized (NM_SETTING_WIRED_S390_SUBCHANNELS,
"z/VM Subchannels",
"Identifies specific subchannels that this "
"network device uses for communcation with z/VM "
......
......@@ -58,7 +58,7 @@ GQuark nm_setting_wired_error_quark (void);
#define NM_SETTING_WIRED_AUTO_NEGOTIATE "auto-negotiate"
#define NM_SETTING_WIRED_MAC_ADDRESS "mac-address"
#define NM_SETTING_WIRED_MTU "mtu"
#define NM_SETTING_WIRED_ZVM_SUBCHANNELS "zvm-subchannels"
#define NM_SETTING_WIRED_S390_SUBCHANNELS "s390-subchannels"
typedef struct {
NMSetting parent;
......@@ -76,14 +76,14 @@ typedef struct {
GType nm_setting_wired_get_type (void);
NMSetting * nm_setting_wired_new (void);
const char * nm_setting_wired_get_port (NMSettingWired *setting);
guint32 nm_setting_wired_get_speed (NMSettingWired *setting);
const char * nm_setting_wired_get_duplex (NMSettingWired *setting);
gboolean nm_setting_wired_get_auto_negotiate (NMSettingWired *setting);
const GByteArray *nm_setting_wired_get_mac_address (NMSettingWired *setting);
guint32 nm_setting_wired_get_mtu (NMSettingWired *setting);
const GPtrArray * nm_setting_wired_get_zvm_subchannels (NMSettingWired *setting);
NMSetting * nm_setting_wired_new (void);
const char * nm_setting_wired_get_port (NMSettingWired *setting);
guint32 nm_setting_wired_get_speed (NMSettingWired *setting);
const char * nm_setting_wired_get_duplex (NMSettingWired *setting);
gboolean nm_setting_wired_get_auto_negotiate (NMSettingWired *setting);
const GByteArray *nm_setting_wired_get_mac_address (NMSettingWired *setting);
guint32 nm_setting_wired_get_mtu (NMSettingWired *setting);
const GPtrArray * nm_setting_wired_get_s390_subchannels (NMSettingWired *setting);
G_END_DECLS
......
......@@ -554,10 +554,10 @@ parse_subchannels (const char *subchannels, guint32 *a, guint32 *b, guint32 *c)
return TRUE;
}
#define SUBCHAN_TAG "zvm-subchannels:"
#define SUBCHAN_TAG "s390-subchannels:"
gboolean
nm_match_spec_zvm_subchannels (const GSList *specs, const char *subchannels)
nm_match_spec_s390_subchannels (const GSList *specs, const char *subchannels)
{
const GSList *iter;
guint32 a = 0, b = 0, c = 0;
......
......@@ -48,7 +48,7 @@ void nm_utils_call_dispatcher (const char *action,
const char *vpn_iface);
gboolean nm_match_spec_hwaddr (const GSList *specs, const char *hwaddr);
gboolean nm_match_spec_zvm_subchannels (const GSList *specs, const char *subchannels);
gboolean nm_match_spec_s390_subchannels (const GSList *specs, const char *subchannels);
GHashTable *value_hash_create (void);
......
......@@ -105,7 +105,7 @@ typedef struct {
gboolean disposed;
struct ether_addr hw_addr;
char * zvm_subchannels;
char * s390_subchannels;
gboolean carrier;
NMNetlinkMonitor * monitor;
......@@ -1528,8 +1528,8 @@ spec_match_list (NMDevice *device, const GSList *specs)
matched = nm_match_spec_hwaddr (specs, hwaddr);
g_free (hwaddr);
if (!matched && priv->zvm_subchannels)
matched = nm_match_spec_zvm_subchannels (specs, priv->zvm_subchannels);
if (!matched && priv->s390_subchannels)
matched = nm_match_spec_s390_subchannels (specs, priv->s390_subchannels);
return matched;
}
......
......@@ -108,11 +108,11 @@ struct _NMSystemConfigInterface {
* Method: mac Data: device MAC address formatted with leading zeros and
* lowercase letters, like 00:0a:0b:0c:0d:0e
*
* Method: zvm-subchannels Data: string of 2 or 3 z/VM subchannels
* separated by commas (,) that identify the
* device, like "0.0.09a0,0.0.09a1,0.0.09a2".
* The string may contain only the following
* characters: [a-fA-F0-9,.]
* Method: s390-subchannels Data: string of 2 or 3 s390 subchannels
* separated by commas (,) that identify the
* device, like "0.0.09a0,0.0.09a1,0.0.09a2".
* The string may contain only the following
* characters: [a-fA-F0-9,.]
*/
GSList * (*get_unmanaged_specs) (NMSystemConfigInterface *config);
......
......@@ -2995,12 +2995,12 @@ make_wired_setting (shvarFile *ifcfg,
if (num_chans == 3)
g_ptr_array_add (array, chans[2]);
g_object_set (s_wired, NM_SETTING_WIRED_ZVM_SUBCHANNELS, array, NULL);
g_object_set (s_wired, NM_SETTING_WIRED_S390_SUBCHANNELS, array, NULL);
g_ptr_array_free (array, TRUE);
/* set the unmanaged spec too */
if (!nm_controlled && !*unmanaged)
*unmanaged = g_strdup_printf ("zvm-subchannels:%s", value);
*unmanaged = g_strdup_printf ("s390-subchannels:%s", value);
}
g_strfreev (chans);
}
......
......@@ -5160,17 +5160,17 @@ test_read_wired_qeth_static (void)
NM_SETTING_WIRED_MAC_ADDRESS);
/* Subchannels */
subchannels = nm_setting_wired_get_zvm_subchannels (s_wired);
subchannels = nm_setting_wired_get_s390_subchannels (s_wired);
ASSERT (subchannels != NULL,
"wired-qeth-static-verify-wired", "failed to verify %s: missing %s / %s key",
TEST_IFCFG_WIRED_QETH_STATIC,
NM_SETTING_WIRED_SETTING_NAME,
NM_SETTING_WIRED_ZVM_SUBCHANNELS);
NM_SETTING_WIRED_S390_SUBCHANNELS);
ASSERT (subchannels->len == 3,
"wired-qeth-static-verify-wired", "failed to verify %s: invalid %s / %s key (not 3 elements)",
TEST_IFCFG_WIRED_QETH_STATIC,
NM_SETTING_WIRED_SETTING_NAME,
NM_SETTING_WIRED_ZVM_SUBCHANNELS);
NM_SETTING_WIRED_S390_SUBCHANNELS);
tmp = (const char *) g_ptr_array_index (subchannels, 0);
ASSERT (strcmp (tmp, expected_channel0) == 0,
......@@ -8306,7 +8306,7 @@ test_write_wired_qeth_dhcp (void)
g_ptr_array_add (subchans, "0.0.601");
g_ptr_array_add (subchans, "0.0.602");
g_object_set (s_wired,
NM_SETTING_WIRED_ZVM_SUBCHANNELS, subchans,
NM_SETTING_WIRED_S390_SUBCHANNELS, subchans,
NULL);
g_ptr_array_free (subchans, TRUE);
......
......@@ -826,7 +826,7 @@ write_wired_setting (NMConnection *connection, shvarFile *ifcfg, GError **error)
const GByteArray *mac;
char *tmp;
guint32 mtu;
const GPtrArray *zvm_subchannels;
const GPtrArray *s390_subchannels;
s_wired = (NMSettingWired *) nm_connection_get_setting (connection, NM_TYPE_SETTING_WIRED);
if (!s_wired) {
......@@ -854,17 +854,17 @@ write_wired_setting (NMConnection *connection, shvarFile *ifcfg, GError **error)
}
svSetValue (ifcfg, "SUBCHANNELS", NULL, FALSE);
zvm_subchannels = nm_setting_wired_get_zvm_subchannels (s_wired);
if (zvm_subchannels) {
if (zvm_subchannels->len == 2) {
s390_subchannels = nm_setting_wired_get_s390_subchannels (s_wired);
if (s390_subchannels) {
if (s390_subchannels->len == 2) {
tmp = g_strdup_printf ("%s,%s",
(const char *) g_ptr_array_index (zvm_subchannels, 0),
(const char *) g_ptr_array_index (zvm_subchannels, 1));
} else if (zvm_subchannels->len == 3) {
(const char *) g_ptr_array_index (s390_subchannels, 0),
(const char *) g_ptr_array_index (s390_subchannels, 1));
} else if (s390_subchannels->len == 3) {
tmp = g_strdup_printf ("%s,%s,%s",
(const char *) g_ptr_array_index (zvm_subchannels, 0),
(const char *) g_ptr_array_index (zvm_subchannels, 1),
(const char *) g_ptr_array_index (zvm_subchannels, 2));
(const char *) g_ptr_array_index (s390_subchannels, 0),
(const char *) g_ptr_array_index (s390_subchannels, 1),
(const char *) g_ptr_array_index (s390_subchannels, 2));
}
svSetValue (ifcfg, "SUBCHANNELS", tmp, FALSE);
g_free (tmp);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment