char *linux_md_component_level;
int linux_md_component_num_raid_devices;
char *linux_md_component_uuid;
+ char *linux_md_component_home_host;
char *linux_md_component_name;
char *linux_md_component_version;
guint64 linux_md_component_update_time;
char *linux_md_level;
int linux_md_num_raid_devices;
char *linux_md_uuid;
+ char *linux_md_home_host;
char *linux_md_name;
char *linux_md_version;
GPtrArray *linux_md_slaves;
PROP_LINUX_MD_COMPONENT_LEVEL,
PROP_LINUX_MD_COMPONENT_NUM_RAID_DEVICES,
PROP_LINUX_MD_COMPONENT_UUID,
+ PROP_LINUX_MD_COMPONENT_HOME_HOST,
PROP_LINUX_MD_COMPONENT_NAME,
PROP_LINUX_MD_COMPONENT_VERSION,
PROP_LINUX_MD_COMPONENT_UPDATE_TIME,
PROP_LINUX_MD_LEVEL,
PROP_LINUX_MD_NUM_RAID_DEVICES,
PROP_LINUX_MD_UUID,
+ PROP_LINUX_MD_HOME_HOST,
PROP_LINUX_MD_NAME,
PROP_LINUX_MD_VERSION,
PROP_LINUX_MD_SLAVES,
case PROP_LINUX_MD_COMPONENT_UUID:
g_value_set_string (value, device->priv->info.linux_md_component_uuid);
break;
+ case PROP_LINUX_MD_COMPONENT_HOME_HOST:
+ g_value_set_string (value, device->priv->info.linux_md_component_home_host);
+ break;
case PROP_LINUX_MD_COMPONENT_NAME:
g_value_set_string (value, device->priv->info.linux_md_component_name);
break;
case PROP_LINUX_MD_UUID:
g_value_set_string (value, device->priv->info.linux_md_uuid);
break;
+ case PROP_LINUX_MD_HOME_HOST:
+ g_value_set_string (value, device->priv->info.linux_md_home_host);
+ break;
case PROP_LINUX_MD_NAME:
g_value_set_string (value, device->priv->info.linux_md_name);
break;
g_param_spec_string ("linux-md-component-uuid", NULL, NULL, NULL, G_PARAM_READABLE));
g_object_class_install_property (
object_class,
+ PROP_LINUX_MD_COMPONENT_HOME_HOST,
+ g_param_spec_string ("linux-md-component-home-host", NULL, NULL, NULL, G_PARAM_READABLE));
+ g_object_class_install_property (
+ object_class,
PROP_LINUX_MD_COMPONENT_NAME,
g_param_spec_string ("linux-md-component-name", NULL, NULL, NULL, G_PARAM_READABLE));
g_object_class_install_property (
g_param_spec_string ("linux-md-uuid", NULL, NULL, NULL, G_PARAM_READABLE));
g_object_class_install_property (
object_class,
+ PROP_LINUX_MD_HOME_HOST,
+ g_param_spec_string ("linux-md-home-host", NULL, NULL, NULL, G_PARAM_READABLE));
+ g_object_class_install_property (
+ object_class,
PROP_LINUX_MD_NAME,
g_param_spec_string ("linux-md-name", NULL, NULL, NULL, G_PARAM_READABLE));
g_object_class_install_property (
g_free (device->priv->info.linux_md_component_level);
g_free (device->priv->info.linux_md_component_uuid);
+ g_free (device->priv->info.linux_md_component_home_host);
g_free (device->priv->info.linux_md_component_name);
g_free (device->priv->info.linux_md_component_version);
g_free (device->priv->info.linux_md_level);
g_free (device->priv->info.linux_md_uuid);
+ g_free (device->priv->info.linux_md_home_host);
g_free (device->priv->info.linux_md_name);
g_free (device->priv->info.linux_md_version);
g_ptr_array_foreach (device->priv->info.linux_md_slaves, (GFunc) g_free, NULL);
}
} else if (strcmp (key, "ID_FS_LABEL") == 0) {
device->priv->info.id_label = g_strdup (value);
- if (device->priv->info.device_is_linux_md_component) {
- device->priv->info.linux_md_component_name = g_strdup (value);
- }
} else if (strcmp (key, "ID_VENDOR") == 0) {
if (device->priv->info.device_is_drive && device->priv->info.drive_vendor == NULL)
}
} else if (strcmp (key, "MD_NAME") == 0) {
- if (device->priv->info.device_is_linux_md)
- device->priv->info.linux_md_name = g_strdup (value);
+ gchar **tokens;
+ const gchar *home_host;
+ const gchar *name;
+
+ tokens = g_strsplit (value, ":", 2);
+
+ if (g_strv_length (tokens) == 2) {
+ home_host = tokens[0];
+ name = tokens[1];
+ } else {
+ name = tokens[0];
+ }
+
+ if (device->priv->info.device_is_linux_md) {
+ device->priv->info.linux_md_home_host = g_strdup (home_host);
+ device->priv->info.linux_md_name = g_strdup (name);
+ } else if (device->priv->info.device_is_linux_md_component) {
+ device->priv->info.linux_md_component_home_host = g_strdup (home_host);
+ device->priv->info.linux_md_component_name = g_strdup (name);
+ }
+
+ g_strfreev (tokens);
} else if (strcmp (key, "DKD_DM_NAME") == 0) {
is TRUE.
</doc:para></doc:description></doc:doc>
</property>
+ <property name="linux-md-component-home-host" type="s" access="read">
+ <doc:doc><doc:description><doc:para>
+ The home host of the array the component is part of, e.g. where it was created. Blank if the array
+ has pre-1.0 meta data.
+ This property is only valid if
+ <doc:ref type="property" to="Device:device-is-linux-md-component">device-is-linux-md-component</doc:ref>
+ is TRUE.
+ </doc:para></doc:description></doc:doc>
+ </property>
<property name="linux-md-component-version" type="s" access="read">
<doc:doc><doc:description><doc:para>
The version of superblock of the component.
is TRUE.
</doc:para></doc:description></doc:doc>
</property>
+ <property name="linux-md-home-host" type="s" access="read">
+ <doc:doc><doc:description><doc:para>
+ The home host of the array, e.g. where if was created. Blank if the array
+ has pre-1.0 meta data.
+ <doc:ref type="property" to="Device:device-is-linux-md">device-is-linux-md</doc:ref>
+ is TRUE.
+ </doc:para></doc:description></doc:doc>
+ </property>
<property name="linux-md-name" type="s" access="read">
<doc:doc><doc:description><doc:para>
The name of the array. Blank if the array
char *linux_md_component_level;
int linux_md_component_num_raid_devices;
char *linux_md_component_uuid;
+ char *linux_md_component_home_host;
char *linux_md_component_name;
char *linux_md_component_version;
guint64 linux_md_component_update_time;
char *linux_md_level;
int linux_md_num_raid_devices;
char *linux_md_uuid;
+ char *linux_md_home_host;
char *linux_md_name;
char *linux_md_version;
char **linux_md_slaves;
props->linux_md_component_num_raid_devices = g_value_get_int (value);
else if (strcmp (key, "linux-md-component-uuid") == 0)
props->linux_md_component_uuid = g_strdup (g_value_get_string (value));
+ else if (strcmp (key, "linux-md-component-home-host") == 0)
+ props->linux_md_component_home_host = g_strdup (g_value_get_string (value));
else if (strcmp (key, "linux-md-component-name") == 0)
props->linux_md_component_name = g_strdup (g_value_get_string (value));
else if (strcmp (key, "linux-md-component-version") == 0)
props->linux_md_num_raid_devices = g_value_get_int (value);
else if (strcmp (key, "linux-md-uuid") == 0)
props->linux_md_uuid = g_strdup (g_value_get_string (value));
+ else if (strcmp (key, "linux-md-home-host") == 0)
+ props->linux_md_home_host = g_strdup (g_value_get_string (value));
else if (strcmp (key, "linux-md-name") == 0)
props->linux_md_name = g_strdup (g_value_get_string (value));
else if (strcmp (key, "linux-md-version") == 0)
g_value_unset (&(props->drive_smart_attributes));
g_free (props->linux_md_component_level);
g_free (props->linux_md_component_uuid);
+ g_free (props->linux_md_component_home_host);
g_free (props->linux_md_component_name);
g_free (props->linux_md_component_version);
g_free (props->linux_md_level);
g_free (props->linux_md_uuid);
+ g_free (props->linux_md_home_host);
g_free (props->linux_md_name);
g_free (props->linux_md_version);
g_strfreev (props->linux_md_slaves);
g_print (" RAID level: %s\n", props->linux_md_component_level);
g_print (" num comp: %d\n", props->linux_md_component_num_raid_devices);
g_print (" uuid: %s\n", props->linux_md_component_uuid);
+ g_print (" home host: %s\n", props->linux_md_component_home_host);
g_print (" name: %s\n", props->linux_md_component_name);
g_print (" version: %s\n", props->linux_md_component_version);
g_print (" update time: %" G_GUINT64_FORMAT " (%s)\n", props->linux_md_component_update_time, time_buf);
g_print (" linux md:\n");
g_print (" RAID level: %s\n", props->linux_md_level);
g_print (" uuid: %s\n", props->linux_md_uuid);
+ g_print (" home host: %s\n", props->linux_md_home_host);
g_print (" name: %s\n", props->linux_md_name);
g_print (" num comp: %d\n", props->linux_md_num_raid_devices);
g_print (" version: %s\n", props->linux_md_version);