Ignore:
Timestamp:
2019-08-06T19:20:35Z (5 years ago)
Author:
Matthieu Riolo <matthieu.riolo@…>
Children:
3f05ef7
Parents:
72c8f77
git-author:
Michal Koutný <xm.koutny+hos@…> (2015-06-17 23:02:03)
git-committer:
Matthieu Riolo <matthieu.riolo@…> (2019-08-06 19:20:35)
Message:

sysman: Instrumented locsrv for autostart

  • also refactored unit name derivation in other brokers
  • exposee creation is not used in unit's lifecycle (failed assertion)

Conflicts:

uspace/lib/c/generic/loc.c
uspace/srv/devman/driver.c
uspace/srv/devman/drv_conn.c
uspace/srv/hid/compositor/compositor.c
uspace/srv/locsrv/locsrv.c
uspace/srv/vfs/vfs.h
uspace/srv/vfs/vfs_ops.c
uspace/srv/vfs/vfs_register.c

File:
1 edited

Legend:

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

    r72c8f77 r63a3276  
    2929#include <errno.h>
    3030#include <ipc/sysman.h>
     31#include <stdlib.h>
    3132
     33#include "configuration.h"
    3234#include "connection_broker.h"
    3335#include "log.h"
     36#include "sysman.h"
    3437
    3538static void sysman_broker_register(ipc_callid_t iid, ipc_call_t *icall)
     
    5457static void sysman_main_exposee_added(ipc_callid_t iid, ipc_call_t *icall)
    5558{
    56         sysman_log(LVL_DEBUG2, "%s", __func__);
    57         async_answer_0(iid, ENOTSUP);
    58         // TODO implement
     59        char *unit_name = NULL;
     60        sysarg_t retval;
     61
     62        int rc = async_data_write_accept((void **) &unit_name, true,
     63            0, 0, 0, NULL);
     64        if (rc != EOK) {
     65                retval = rc;
     66                goto finish;
     67        }
     68
     69        unit_t *unit = configuration_find_unit_by_name(unit_name);
     70        if (unit == NULL) {
     71                //sysman_log(LVL_NOTE, "Unit '%s' not found.", unit_name);
     72                retval = ENOENT;
     73                goto finish;
     74        }
     75
     76        // TODO propagate caller task ID
     77        sysman_raise_event(&sysman_event_unit_exposee_created, unit);
     78
     79        retval = EOK;
     80
     81finish:
     82        async_answer_0(iid, retval);
     83        free(unit_name);
    5984}
    6085
    6186static void sysman_exposee_added(ipc_callid_t iid, ipc_call_t *icall)
    6287{
    63         sysman_log(LVL_DEBUG2, "%s", __func__);
    64         async_answer_0(iid, ENOTSUP);
    65         // TODO implement
     88        char *exposee = NULL;
     89        sysarg_t retval;
     90
     91        /* Just accept data and further not supported. */
     92        int rc = async_data_write_accept((void **) &exposee, true,
     93            0, 0, 0, NULL);
     94        if (rc != EOK) {
     95                retval = rc;
     96                goto finish;
     97        }
     98
     99        //sysman_log(LVL_DEBUG2, "%s(%s)", __func__, exposee);
     100
     101        retval = ENOTSUP;
     102
     103finish:
     104        async_answer_0(iid, retval);
     105        free(exposee);
    66106}
    67107
Note: See TracChangeset for help on using the changeset viewer.