Changeset 4224ef7 in mainline
- Timestamp:
- 2019-08-06T18:18:37Z (5 years ago)
- Children:
- e55741e
- Parents:
- dd5c623
- git-author:
- Michal Koutný <xm.koutny+hos@…> (2015-05-11 16:50:40)
- git-committer:
- Matthieu Riolo <matthieu.riolo@…> (2019-08-06 18:18:37)
- Location:
- uspace
- Files:
-
- 14 edited
- 1 moved
Legend:
- Unmodified
- Added
- Removed
-
uspace/cfg/sysman/barber.svc
rdd5c623 r4224ef7 1 1 [Unit] 2 ; explicit dependency on compositor,3 ; until exposee to unit name map in locsrv is defined4 After = compositor.svc5 2 After = rootfs.mnt 6 3 -
uspace/cfg/sysman/locfs.mnt
rdd5c623 r4224ef7 1 [Unit]2 ; explicit, VFS not instrumented for autostart3 After = locfs.svc4 5 1 [Mount] 6 2 What = -
uspace/cfg/sysman/rootfs.mnt
rdd5c623 r4224ef7 1 [Unit]2 ; explicit, VFS not instrumented for autostart3 After = fat.svc4 5 1 [Mount] 6 2 What = devices/\hw\pci0\00:01.0\ata-c1\d0 -
uspace/cfg/sysman/vlaunch.svc
rdd5c623 r4224ef7 1 1 [Unit] 2 ; explicit dependency on compositor,3 ; until exposee to unit name map in locsrv is defined4 After = compositor.svc5 2 ; explicit because of executable path 6 3 After = rootfs.mnt … … 8 5 After = locfs.mnt 9 6 10 ; unclear status of vlaunch as service (more relevant to user session)7 ; unclear status of vlaunch as a service (more relevant to user session) 11 8 [Service] 12 9 ExecStart = /root/app/vlaunch comp:0/winreg -
uspace/lib/gui/window.c
rdd5c623 r4224ef7 616 616 win->surface = NULL; 617 617 618 unsigned int ipc_flags = IPC_FLAG_AUTOSTART; 618 619 service_id_t reg_dsid; 619 errno_t rc = loc_service_get_id(winreg, ®_dsid, 0);620 errno_t rc = loc_service_get_id(winreg, ®_dsid, ipc_flags); 620 621 if (rc != EOK) { 621 622 free(win); … … 624 625 625 626 async_sess_t *reg_sess = 626 loc_service_connect(reg_dsid, INTERFACE_COMPOSITOR, 0); 627 loc_service_connect(reg_dsid, INTERFACE_COMPOSITOR, ipc_flags); 628 627 629 if (reg_sess == NULL) { 628 630 free(win); … … 639 641 } 640 642 641 win->osess = loc_service_connect(out_dsid, INTERFACE_COMPOSITOR, 0); 643 644 win->osess = loc_service_connect(out_dsid, INTERFACE_COMPOSITOR, ipc_flags); 645 642 646 if (win->osess == NULL) { 643 647 free(win); … … 645 649 } 646 650 647 win->isess = loc_service_connect(in_dsid, INTERFACE_COMPOSITOR, 0); 651 win->isess = loc_service_connect(in_dsid, INTERFACE_COMPOSITOR, ipc_flags); 652 648 653 if (win->isess == NULL) { 649 654 async_hangup(win->osess); -
uspace/lib/sysman/src/ctl.c
rdd5c623 r4224ef7 33 33 #include <sysman/sysman.h> 34 34 35 /* 36 * TODO 37 * Non-blocking favor of this API is effectively incomplete as it doesn't 38 * provide means how to obtain result of the start operation. 39 * Probably devise individual API for brokers that could exploit the fact that 40 * broker knows when appropriate exposee is created and the request succeeded. 41 * Still though, it's necessary to centralize timeout into sysman. 42 */ 35 43 int sysman_unit_start(const char *unit_name, int flags) 36 44 { -
uspace/srv/locsrv/locsrv.c
rdd5c623 r4224ef7 339 339 char *service_name = NULL; 340 340 341 /* 342 * All services in 'device' namespace are considered to be drivers and 343 * devman is thus requested to start. Otherwise name of unit is made 344 * from fully qualified name of service (namespace separator is changed 345 * for usage in unit name. 346 */ 341 347 if (str_cmp(ns_name, LOC_DEVICE_NAMESPACE) == 0) { 342 348 asprintf(&service_name, "%s", SERVICE_NAME_DEVMAN); … … 359 365 } 360 366 361 //printf("%s(%s) before\n", __func__, unit_name);//DEBUG362 367 int rc = sysman_unit_start(unit_name, IPC_FLAG_BLOCKING); 363 //printf("%s(%s) after %i\n", __func__, unit_name, rc);//DEBUG364 368 free(unit_name); 365 369 free(service_name); … … 811 815 */ 812 816 if (svc == NULL) { 813 //printf("%s: service '%s/%s' not found\n", NAME, ns_name, name);//DEBUG 814 if (flags & (IPC_FLAG_AUTOSTART | IPC_FLAG_BLOCKING)) { 815 /* TODO: 816 * consider non-blocking service start, return 817 * some dummy id and block only after connection 818 * request (actually makes more sense as those who asks 819 * for ID might be someone else than those connecting) 820 */ 821 if (!start_requested && (flags & IPC_FLAG_AUTOSTART)) { 822 rc = loc_service_request_start(ns_name, name); 823 if (rc != EOK) { 824 goto finish; 825 } 826 start_requested = true; 817 /* TODO: 818 * consider non-blocking service start, return 819 * some dummy id and block only after connection 820 * request (actually makes more sense as those who asks 821 * for ID might be someone else than those connecting) 822 * Note: 823 * service_list_mutex is released as we don't need to keep it 824 * while waiting for start request to finish. 825 */ 826 if ((flags & IPC_FLAG_AUTOSTART) && !start_requested) { 827 fibril_mutex_unlock(&services_list_mutex); 828 rc = loc_service_request_start(ns_name, name); 829 fibril_mutex_lock(&services_list_mutex); 830 start_requested = true; 831 832 if (rc != EOK) { 833 goto finish; 834 } else { 835 goto recheck; 827 836 } 828 837 } 838 839 if (flags & IPC_FLAG_BLOCKING) { 829 840 fibril_condvar_wait(&services_list_cv, 830 841 &services_list_mutex); … … 833 844 rc = ENOENT; 834 845 } else { 835 //printf("%s: service '%s/%s' FOUND\n", NAME, ns_name, name);//DEBUG836 846 rc = EOK; 837 847 } … … 1621 1631 1622 1632 /* Let sysman know we are broker */ 1623 printf("%s: sysman_broker_register : pre\n", NAME);1624 1633 rc = sysman_broker_register(); 1625 printf("%s: sysman_broker_register : post\n", NAME);1626 1634 if (rc != EOK) { 1627 1635 printf("%s: Error registering at sysman (%i)\n", NAME, rc); -
uspace/srv/sysman/connection_broker.c
rdd5c623 r4224ef7 37 37 sysman_log(LVL_DEBUG2, "%s", __func__); 38 38 async_answer_0(iid, EOK); 39 // TODO implement 39 /* TODO implement 40 * What exactly? Similar behavior that has locsrv with servers, 41 * so that subsequent calls can be assigned to broker. Still that 42 * makes sense only when brokers will somehow scope unit/exposee 43 * names. Why I wanted this registration? 44 */ 40 45 } 41 46 -
uspace/srv/sysman/sysman.c
rdd5c623 r4224ef7 160 160 /** Create and queue job for unit 161 161 * 162 * @param[in] callback callback must explicitly delete reference to job 162 * @param[in] callback (optional) callback must explicitly delete reference 163 * to job 163 164 */ 164 165 int sysman_queue_job(unit_t *unit, unit_state_t target_state, … … 170 171 } 171 172 172 job_add_ref(job); 173 sysman_object_observer(job, callback, callback_arg); 173 if (callback != NULL) { 174 job_add_ref(job); 175 sysman_object_observer(job, callback, callback_arg); 176 } 174 177 175 178 job_add_ref(job); -
uspace/srv/sysman/units/unit_mnt.c
rdd5c623 r4224ef7 151 151 { 152 152 mount_data_t *mnt_data = arg; 153 /*sysman_log(LVL_DEBUG2, "%s(%p, %p, %p, %p, %x, %u)",153 sysman_log(LVL_DEBUG2, "%s(%p, %p, %p, %p, %x, %u)", 154 154 __func__, 155 155 mnt_data->type, mnt_data->mountpoint, mnt_data->device, mnt_data->options, 156 mnt_data->flags, mnt_data->instance);*/ 156 mnt_data->flags, mnt_data->instance); 157 157 158 int rc = mount(mnt_data->type, mnt_data->mountpoint, mnt_data->device, 158 159 mnt_data->options ? mnt_data->options : "", -
uspace/srv/sysman/units/unit_svc.c
rdd5c623 r4224ef7 87 87 int rc = task_spawnv(NULL, NULL, u_svc->exec_start.path, 88 88 u_svc->exec_start.argv); 89 sysman_log(LVL_DEBUG2, "task_spawn(%s, %s)", u_svc->exec_start.path, u_svc->exec_start.argv[0]); 89 90 90 if (rc != EOK) { 91 91 unit->state = STATE_FAILED; -
uspace/srv/vfs/Makefile
rdd5c623 r4224ef7 29 29 30 30 USPACE_PREFIX = ../.. 31 LIBS = $(LIBSYSMAN_PREFIX)/libsysman.a 32 EXTRA_CFLAGS += -I$(LIBSYSMAN_PREFIX)/include 31 33 BINARY = vfs 32 34 STATIC_NEEDED = y -
uspace/srv/vfs/vfs.c
rdd5c623 r4224ef7 40 40 #include <ipc/services.h> 41 41 #include <abi/ipc/methods.h> 42 #include <libarch/config.h>43 42 #include <ns.h> 43 #include <as.h> 44 44 #include <async.h> 45 #include <atomic.h> 45 46 #include <errno.h> 46 47 #include <str_error.h> 47 48 #include <stdio.h> 49 #include <ipc/services.h> 50 #include <macros.h> 48 51 #include <stdbool.h> 52 #include <stdio.h> 49 53 #include <str.h> 50 #include <as.h> 51 #include <macros.h> 54 #include <sysman/broker.h> 52 55 #include "vfs.h" 53 56 … … 145 148 146 149 /* 150 * Let sysman know we are broker 151 */ 152 rc = sysman_broker_register(); 153 if (rc != EOK) { 154 printf("%s: Error registering at sysman (%i)\n", NAME, rc); 155 return rc; 156 } 157 158 /* 147 159 * Start accepting connections. 148 160 */ -
uspace/srv/vfs/vfs_ops.c
rdd5c623 r4224ef7 137 137 while (true) { 138 138 fs_handle = fs_name_to_handle(instance, fsname, false); 139 if (!fs_handle) { 140 if ((flags & IPC_FLAG_AUTOSTART)) { 141 /* 142 * Temporarily release the lock, we don't need it while 143 * waiting for start request (which may lead to deadlock). 144 */ 145 fibril_mutex_unlock(&fs_list_lock); 146 rc = vfs_fs_request_start(fs_name, instance); 147 fibril_mutex_lock(&fs_list_lock); 148 149 if (rc != EOK) { 150 fibril_mutex_unlock(&fs_list_lock); 151 async_answer_0(callid, rc); 152 async_answer_0(rid, rc); 153 free(mp); 154 free(fs_name); 155 free(opts); 156 return; 157 } 158 /* 159 * Succesful start request, new server should be 160 * registered. 161 */ 162 continue; 163 } 164 } 139 165 140 166 if (fs_handle != 0 || !(flags & VFS_MOUNT_BLOCKING)) … … 188 214 189 215 return EOK; 216 } 217 218 static int vfs_fs_request_start(const char *fs_name, unsigned int instance) 219 { 220 char *unit_name = NULL; 221 222 assert(instance == 0); 223 /* 224 * Unit name is made simply by considering service of the same name as 225 * given FS name. 226 * TODO instance identifier is not implemented. 227 */ 228 asprintf(&unit_name, "%s%c%s", fs_name, UNIT_NAME_SEPARATOR, 229 UNIT_SVC_TYPE_NAME); 230 if (unit_name == NULL) { 231 return ENOMEM; 232 } 233 234 int rc = sysman_unit_start(unit_name, IPC_FLAG_BLOCKING); 235 236 free(unit_name); 237 return rc; 190 238 } 191 239
Note:
See TracChangeset
for help on using the changeset viewer.