Changeset 102f641 in mainline for uspace/srv/sysman/units
- Timestamp:
- 2019-09-02T19:01:50Z (6 years ago)
- Children:
- 25697163
- Parents:
- 241f1985
- Location:
- uspace/srv/sysman/units
- Files:
-
- 6 edited
-
unit_cfg.c (modified) (4 diffs)
-
unit_mnt.c (modified) (5 diffs)
-
unit_mnt.h (modified) (2 diffs)
-
unit_svc.c (modified) (6 diffs)
-
unit_svc.h (modified) (1 diff)
-
unit_tgt.c (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
uspace/srv/sysman/units/unit_cfg.c
r241f1985 r102f641 46 46 47 47 static config_item_t unit_configuration[] = { 48 { "Path", &config_parse_string, offsetof(unit_cfg_t, path), NULL},48 { "Path", &config_parse_string, offsetof(unit_cfg_t, path), NULL }, 49 49 CONFIGURATION_ITEM_SENTINEL 50 50 }; … … 81 81 goto finish; 82 82 } 83 83 84 84 /* We parse files as part of ongoing repo transaction (locked). */ 85 85 unit_t *u = repo_find_unit_by_name_unsafe(unit_name); … … 231 231 232 232 errno_t rc = cfg_load_configuration(u_cfg->path); 233 233 234 234 if (rc == EOK) { 235 235 unit->state = STATE_STARTED; … … 267 267 } 268 268 269 DEFINE_UNIT_VMT(unit_cfg) 270 269 DEFINE_UNIT_VMT(unit_cfg); -
uspace/srv/sysman/units/unit_mnt.c
r241f1985 r102f641 41 41 42 42 static config_item_t unit_configuration[] = { 43 { "What", &config_parse_string, offsetof(unit_mnt_t, device), NULL},44 { "Where", &config_parse_string, offsetof(unit_mnt_t, mountpoint), NULL},45 { "Type", &config_parse_string, offsetof(unit_mnt_t, type), NULL},46 { "Autostart", &config_parse_bool, offsetof(unit_mnt_t, autostart), "true"},47 { "Blocking", &config_parse_bool, offsetof(unit_mnt_t, blocking), "true"},43 { "What", &config_parse_string, offsetof(unit_mnt_t, device), NULL }, 44 { "Where", &config_parse_string, offsetof(unit_mnt_t, mountpoint), NULL }, 45 { "Type", &config_parse_string, offsetof(unit_mnt_t, type), NULL }, 46 { "Autostart", &config_parse_bool, offsetof(unit_mnt_t, autostart), "true" }, 47 { "Blocking", &config_parse_bool, offsetof(unit_mnt_t, blocking), "true" }, 48 48 CONFIGURATION_ITEM_SENTINEL 49 49 }; … … 195 195 assert(!u_mnt->autostart || u_mnt->blocking); 196 196 197 198 197 assert(unit->state == STATE_STOPPED); 199 198 … … 203 202 mnt_data.mountpoint = u_mnt->mountpoint; 204 203 mnt_data.device = u_mnt->device; 205 /* TODO use other mount parameters 204 /* 205 * TODO use other mount parameters 206 206 * mnt_data.options = u_mnt->options; 207 207 * mnt_data.instance = u_mnt->instance; … … 235 235 assert(!u_mnt->autostart || u_mnt->blocking); 236 236 237 238 237 // note: we should never hit STATE_STARTING, since it'd mean there are 239 238 // two jobs running at once (unless job cancellation is implemented) … … 284 283 } 285 284 286 287 DEFINE_UNIT_VMT(unit_mnt) 288 285 DEFINE_UNIT_VMT(unit_mnt); -
uspace/srv/sysman/units/unit_mnt.h
r241f1985 r102f641 39 39 char *device; 40 40 41 /** Should be underlying units (FS server, device) be autostarted 42 * (implies blocking) */ 41 /** 42 * Should be underlying units (FS server, device) be autostarted 43 * (implies blocking) 44 */ 43 45 bool autostart; 44 46 … … 50 52 51 53 #endif 52 -
uspace/srv/sysman/units/unit_svc.c
r241f1985 r102f641 40 40 41 41 static config_item_t unit_configuration[] = { 42 { "ExecStart", &util_parse_command, offsetof(unit_svc_t, exec_start), NULL},42 { "ExecStart", &util_parse_command, offsetof(unit_svc_t, exec_start), NULL }, 43 43 CONFIGURATION_ITEM_SENTINEL 44 44 }; … … 82 82 assert(u_svc); 83 83 84 85 84 assert(unit->state == STATE_STOPPED); 86 85 … … 117 116 assert(u_svc); 118 117 119 120 118 // note: May change when job cancellation is possible. 121 119 assert(unit->state == STATE_STARTED); … … 133 131 134 132 if (rc != EOK) { 135 /* Task may still be running, but be conservative about unit's 136 * state. */ 133 /* 134 * Task may still be running, but be conservative about unit's 135 * state. 136 */ 137 137 unit->state = STATE_FAILED; 138 138 return rc; … … 144 144 } 145 145 146 147 146 static void unit_svc_exposee_created(unit_t *unit) 148 147 { 149 148 assert(CAST_SVC(unit)); 150 assert(unit->state == STATE_STOPPED || unit->state == STATE_STARTING || unit->state ==STATE_STARTED);149 assert(unit->state == STATE_STOPPED || unit->state == STATE_STARTING || unit->state == STATE_STARTED); 151 150 152 151 /* Exposee itself doesn't represent started unit. */ … … 160 159 } 161 160 162 DEFINE_UNIT_VMT(unit_svc) 163 161 DEFINE_UNIT_VMT(unit_svc); -
uspace/srv/sysman/units/unit_svc.h
r241f1985 r102f641 51 51 52 52 #endif 53 -
uspace/srv/sysman/units/unit_tgt.c
r241f1985 r102f641 82 82 } 83 83 84 85 DEFINE_UNIT_VMT(unit_tgt) 86 84 DEFINE_UNIT_VMT(unit_tgt);
Note:
See TracChangeset
for help on using the changeset viewer.
