-->
<property name="Size" type="t" access="read"/>
- <!-- TODO: array state -->
+ <!-- SyncAction:
+ The current state of the array or empty if the array is not
+ running.
+
+ This property corresponds to the
+ <literal>sync_action</literal> sysfs file, see the
+ <filename><ulink url="http://www.kernel.org/doc/Documentation/md.txt">Documentation/md.txt</ulink></filename>
+ file shipped with the kernel sources.
+ -->
+ <property name="SyncAction" type="s" access="read"/>
+
+ <!-- Degraded:
+ Number of devices by which the array is degraded (0 if not degraded).
+
+ This property corresponds to the
+ <literal>degraded</literal> sysfs file, see the
+ <filename><ulink url="http://www.kernel.org/doc/Documentation/md.txt">Documentation/md.txt</ulink></filename>
+ file shipped with the kernel sources.
+ -->
+ <property name="Degraded" type="u" access="read"/>
<!-- TODO: start/stop methods -->
GUdevDevice *raid_device;
GList *member_devices;
GUdevDevice *member_device;
+ guint degraded;
+ const gchar *sync_action = "";
member_devices = udisks_linux_mdraid_object_get_members (object);
if (member_devices == NULL)
udisks_mdraid_set_num_devices (iface, num_devices);
udisks_mdraid_set_size (iface, size);
+ if (raid_device != NULL)
+ {
+ degraded = g_udev_device_get_sysfs_attr_as_int (raid_device, "md/degraded");
+ sync_action = g_udev_device_get_sysfs_attr (raid_device, "md/sync_action");
+ }
+ udisks_mdraid_set_degraded (iface, degraded);
+ udisks_mdraid_set_sync_action (iface, sync_action);
+
/* TODO: set other stuff */
out: