Skip to content

Commit

Permalink
MDRaid: Add 'Running' property.
Browse files Browse the repository at this point in the history
Looking at MDRaid.ActiveDevices or Block.MDRaid gives the same
information, but only asynchronously.

Fixes #12
  • Loading branch information
mvollmer committed Jul 2, 2015
1 parent 1bba3ca commit d2f6be2
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
8 changes: 8 additions & 0 deletions data/org.storaged.Storaged.xml
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@

<!DOCTYPE node PUBLIC
"-//freedesktop//DTD D-BUS Object Introspection 1.0//EN"
"http://www.freedesktop.org/standards/dbus/1.0/introspect.dtd">
Expand Down Expand Up @@ -2014,6 +2015,13 @@
-->
<property name="ChildConfiguration" type="a(sa{sv})" access="read"/>

<!-- Running: Whether or not the array is considered running.
It is an error to call Start on a running array, and Stop on
a non-running array, for example.
-->
<property name="Running" type="b" access="read"/>

<!--
Start:
@options: Options - known options (in addition to <link linkend="storaged-std-options">standard options</link>) includes <parameter>start-degraded</parameter> (of type 'b').
Expand Down
2 changes: 2 additions & 0 deletions src/storagedlinuxmdraid.c
Original file line number Diff line number Diff line change
Expand Up @@ -341,6 +341,8 @@ storaged_linux_mdraid_update (StoragedLinuxMDRaid *mdraid,
storaged_mdraid_set_num_devices (iface, num_devices);
storaged_mdraid_set_size (iface, size);

storaged_mdraid_set_running (iface, raid_device != NULL);

if (g_strcmp0 (level, "raid1") == 0 ||
g_strcmp0 (level, "raid4") == 0 ||
g_strcmp0 (level, "raid5") == 0 ||
Expand Down

0 comments on commit d2f6be2

Please sign in to comment.