Changeset 8d74fdd in mainline for uspace/srv/sysman/connection_ctl.c


Ignore:
Timestamp:
2019-08-17T13:57:05Z (6 years ago)
Author:
Matthieu Riolo <matthieu.riolo@…>
Children:
f92b315
Parents:
be07995
git-author:
Michal Koutný <xm.koutny+hos@…> (2016-01-27 00:01:13)
git-committer:
Matthieu Riolo <matthieu.riolo@…> (2019-08-17 13:57:05)
Message:

sysman: Shutdown operation as shutdown.tgt isolation

Since not all dependencies are captured by graph, sysman and taskman are
ignored when stopping servers, so that they can complete the shutdown
transition.

Conflicts:

boot/Makefile.common

File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/srv/sysman/connection_ctl.c

    rbe07995 r8d74fdd  
    3636#include "connection_ctl.h"
    3737#include "job.h"
     38#include "job_closure.h"
    3839#include "log.h"
     40#include "shutdown.h"
    3941#include "sysman.h"
    4042
     
    114116
    115117        if (!(flags & IPC_FLAG_BLOCKING)) {
    116                 retval = sysman_run_job(unit, STATE_STARTED, NULL, NULL);
     118                retval = sysman_run_job(unit, STATE_STARTED, 0, NULL, NULL);
    117119                goto answer;
    118120        }
     
    123125                goto answer;
    124126        }
    125         retval = sysman_run_job(unit, STATE_STARTED, &answer_callback,
     127        retval = sysman_run_job(unit, STATE_STARTED, 0, &answer_callback,
    126128            iid_ptr);
    127129        if (retval != EOK) {
     
    154156
    155157        if (!(flags & IPC_FLAG_BLOCKING)) {
    156                 retval = sysman_run_job(unit, state, NULL, NULL);
     158                retval = sysman_run_job(unit, state, 0, NULL, NULL);
    157159                goto answer;
    158160        }
     
    163165                goto answer;
    164166        }
    165         retval = sysman_run_job(unit, state, &answer_callback,
     167        retval = sysman_run_job(unit, state, 0, &answer_callback,
    166168            iid_ptr);
    167169        if (retval != EOK) {
     
    278280}
    279281
     282static void sysman_shutdown(ipc_callid_t iid, ipc_call_t *icall)
     283{
     284        int retval;
     285        unit_t *u = repo_find_unit_by_name(TARGET_SHUTDOWN);
     286        if (u == NULL) {
     287                retval = ENOENT;
     288                goto finish;
     289        }
     290
     291        retval = sysman_run_job(u, STATE_STARTED, CLOSURE_ISOLATE,
     292            shutdown_cb, NULL);
     293
     294finish:
     295        async_answer_0(iid, retval);
     296}
     297
    280298void sysman_connection_ctl(ipc_callid_t iid, ipc_call_t *icall)
    281299{
     
    315333                        sysman_unit_get_state(callid, &call);
    316334                        break;
     335                case SYSMAN_CTL_SHUTDOWN:
     336                        sysman_shutdown(callid, &call);
     337                        break;
    317338                default:
    318339                        async_answer_0(callid, ENOENT);
Note: See TracChangeset for help on using the changeset viewer.