diff options
author | David Zeuthen <davidz@redhat.com> | 2010-10-06 15:25:52 -0400 |
---|---|---|
committer | David Zeuthen <davidz@redhat.com> | 2010-10-06 15:25:52 -0400 |
commit | 24bb73bb6c7d7ed7a2fcf6bf3f5e62f08c04641d (patch) | |
tree | eeb9f2af5ac8996abf288a9235af22e25bdb41cb | |
parent | 1331349d2e97bceaadf8d8cf0b6b5c11c83577a5 (diff) |
Nuke can-start-dependencies; use can-start and can-start-degraded instead
This is much nicer since it conveys that the items with deps also get
can-start-degraded, e.g.
MyRaid_RAID:
Type: md-raid
Target: UUID=a4a5646e:933c7856:23bfc059:6e17b7ec
State: can-start-degraded
Slave Devices: /dev/sdb1
MyRaid:
Type: filesystem
Target: UUID=a6f27fe4-97c4-433d-ae52-f2f97939514e
Options: Filesystem:mount_path=/mnt/MyRaid
Filesystem:options=defaults
Dependencies: MyRaid_RAID
State: can-start-degraded
instead of can-start-dependencies.
Signed-off-by: David Zeuthen <davidz@redhat.com>
-rw-r--r-- | stc/stc.c | 3 | ||||
-rw-r--r-- | stc/stcenums.h | 2 | ||||
-rw-r--r-- | stc/stcitem.c | 12 |
3 files changed, 9 insertions, 8 deletions
@@ -727,8 +727,7 @@ handle_command_start_stop (gint *argc, state = stc_item_get_state (item); if (is_start) { - if (state == STC_ITEM_STATE_CAN_START_DEPENDENCIES || - state == STC_ITEM_STATE_CAN_START_DEGRADED || + if (state == STC_ITEM_STATE_CAN_START_DEGRADED || state == STC_ITEM_STATE_CAN_START) { g_print ("%s \n", stc_item_get_id (item)); diff --git a/stc/stcenums.h b/stc/stcenums.h index 394378a..2faaac0 100644 --- a/stc/stcenums.h +++ b/stc/stcenums.h @@ -70,7 +70,6 @@ typedef enum /** * StcItemState: * @STC_ITEM_STATE_NOT_STARTED: The object or one of its dependencies has not been started and cannot be started at this time. - * @STC_ITEM_STATE_CAN_START_DEPENDENCIES: One or more dependent objects are has not been started (but can be started). * @STC_ITEM_STATE_CAN_START_DEGRADED: Like %STC_ITEM_STATE_CAN_START but the object will be started degraded. * @STC_ITEM_STATE_CAN_START: The object is not running but it can be started (e.g. all requisite objects are present and all dependencies are fulfilled). * @STC_ITEM_STATE_STARTED: The object has been started. @@ -80,7 +79,6 @@ typedef enum typedef enum { STC_ITEM_STATE_NOT_STARTED, - STC_ITEM_STATE_CAN_START_DEPENDENCIES, STC_ITEM_STATE_CAN_START_DEGRADED, STC_ITEM_STATE_CAN_START, STC_ITEM_STATE_STARTED, diff --git a/stc/stcitem.c b/stc/stcitem.c index 2e9cd89..8bd9326 100644 --- a/stc/stcitem.c +++ b/stc/stcitem.c @@ -886,11 +886,15 @@ _stc_item_update_state (StcItem *item) /* all good */ break; - default: - /* means we need to wait for the dep... but we need to keep checking in - * case it gets worse + case STC_ITEM_STATE_CAN_START: + case STC_ITEM_STATE_CAN_START_DEGRADED: + /* if we are already CAN_START_DEGRADED, stay there... otherwise + * we want to be DEGRADED if the dependent is DEGRADED... */ - state = STC_ITEM_STATE_CAN_START_DEPENDENCIES; + if (state == STC_ITEM_STATE_CAN_START_DEGRADED) + ; + else + state = depend_item_state; break; } } |