Lines Matching defs:inst
107 libscf_get_running_snapshot(scf_instance_t *inst)
112 h = scf_instance_handle(inst);
120 if (scf_instance_get_snapshot(inst, SMF_SNAPSHOT_RUNNING, snap) == 0)
132 libscf_get_or_make_running_snapshot(scf_instance_t *inst, const char *fmri,
138 h = scf_instance_handle(inst);
144 if (scf_instance_get_snapshot(inst, SMF_SNAPSHOT_RUNNING, snap) == 0)
164 if (_scf_snapshot_take_new(inst, SMF_SNAPSHOT_RUNNING, snap) == 0) {
192 scf_instance_t *inst = NULL;
196 r = libscf_fmri_get_instance(h, fmri, &inst);
215 running = libscf_get_or_make_running_snapshot(inst, fmri, retake);
222 if (scf_instance_get_snapshot(inst, "start", start) != 0) {
230 if (_scf_snapshot_take_new(inst, "start", start) != 0) {
323 scf_instance_destroy(inst);
335 libscf_snapshots_refresh(scf_instance_t *inst, const char *fmri)
341 h = scf_instance_handle(inst);
349 if (scf_instance_get_snapshot(inst, SMF_SNAPSHOT_RUNNING, snap) == 0) {
350 if (_scf_snapshot_take_attach(inst, snap) == 0)
374 if (_scf_snapshot_take_new(inst, SMF_SNAPSHOT_RUNNING,
426 libscf_get_stn_tset(scf_instance_t *inst)
428 scf_handle_t *h = scf_instance_handle(inst);
433 assert(inst != NULL);
448 if (scf_instance_get_pg_composed(inst, NULL, pgname, pg) ==
461 if (scf_instance_get_pg_composed(inst, NULL, pgname, pg) ==
481 scf_instance_t *inst = scf_instance_create(h);
484 if (inst == NULL) {
488 if (scf_handle_decode_fmri(h, SCF_INSTANCE_GLOBAL, NULL, NULL, inst,
493 tset = libscf_get_stn_tset(inst);
496 scf_instance_destroy(inst);
954 * ECONNABORTED, or ECANCELED if inst is deleted.
957 libscf_instance_get_fmri(scf_instance_t *inst, char **retp)
962 if (scf_instance_to_fmri(inst, inst_fmri, max_scf_fmri_size) <= 0) {
996 scf_instance_t *inst;
999 inst = safe_scf_instance_create(h);
1001 r = libscf_lookup_instance(fmri, inst);
1004 *instp = inst;
1006 scf_instance_destroy(inst);
1012 libscf_lookup_instance(const char *fmri, scf_instance_t *inst)
1014 if (scf_handle_decode_fmri(scf_instance_handle(inst), fmri, NULL, NULL,
1015 inst, NULL, NULL, SCF_DECODE_FMRI_EXACT) != SCF_SUCCESS) {
1040 * Read deathrow for inst. Returns 0, ECONNABORTED if the connection to the
1041 * repository is broken, ECANCELED if inst is deleted, or ENOENT if inst
1048 libscf_get_deathrow(scf_handle_t *h, scf_instance_t *inst, int *deathrow)
1056 if (scf_instance_get_pg_composed(inst, NULL, SCF_PG_DEATHROW, pg) !=
1107 * buffer) for inst. Returns 0, ECONNABORTED if the connection to the
1108 * repository is broken, ECANCELED if inst is deleted, or ENOENT if inst
1115 libscf_get_basic_instance_data(scf_handle_t *h, scf_instance_t *inst,
1127 if (scf_instance_get_pg_composed(inst, NULL, SCF_PG_GENERAL_OVR, pg) !=
1178 if (scf_instance_get_pg_composed(inst, NULL, SCF_PG_GENERAL, pg) != 0) {
1241 * ECANCELED - inst is deleted
1247 libscf_inst_get_or_add_pg(scf_instance_t *inst, const char *name,
1253 if (scf_instance_get_pg(inst, name, pg) == 0) {
1313 if (scf_instance_add_pg(inst, name, type, flags, pg) == 0)
1540 * ECANCELED - inst was deleted
1546 libscf_inst_set_boolean_prop(scf_instance_t *inst, const char *pgname,
1554 h = scf_instance_handle(inst);
1558 ret = libscf_inst_get_or_add_pg(inst, pgname, pgtype, pgflags, pg);
1601 * ECANCELED - inst was deleted
1607 libscf_inst_set_count_prop(scf_instance_t *inst, const char *pgname,
1615 h = scf_instance_handle(inst);
1619 ret = libscf_inst_get_or_add_pg(inst, pgname, pgtype, pgflags, pg);
1659 * ECANCELED if inst is deleted, EROFS if the backend is readonly, or EPERM if
1663 libscf_set_enable_ovr(scf_instance_t *inst, int enable)
1665 return (libscf_inst_set_boolean_prop(inst, SCF_PG_GENERAL_OVR,
1672 * ECANCELED if inst is deleted, EROFS if the backend is readonly, or EPERM if
1676 libscf_set_deathrow(scf_instance_t *inst, int deathrow)
1678 return (libscf_inst_set_boolean_prop(inst, SCF_PG_DEATHROW,
1687 libscf_delete_enable_ovr(scf_instance_t *inst)
1689 return (scf_instance_delete_prop(inst, SCF_PG_GENERAL_OVR,
1757 * ECANCELED - inst was deleted
1758 * ENOENT - inst has no milestone property
1762 libscf_get_milestone(scf_instance_t *inst, scf_property_t *prop,
1768 pg = safe_scf_pg_create(scf_instance_handle(inst));
1770 if (scf_instance_get_pg(inst, SCF_PG_OPTIONS_OVR, pg) == 0) {
1805 if (scf_instance_get_pg(inst, SCF_PG_OPTIONS, pg) == 0) {
2061 * Return template values for inst in *common_name suitable for use in
2070 libscf_get_template_values(scf_instance_t *inst, scf_snapshot_t *snap,
2082 h = scf_instance_handle(inst);
2090 if (scf_instance_get_pg_composed(inst, snap, SCF_PG_TM_COMMON_NAME, pg)
2195 * Return startd settings for inst in *flags suitable for use in
2204 libscf_get_startd_properties(scf_instance_t *inst,
2214 h = scf_instance_handle(inst);
2221 if (scf_instance_get_pg_composed(inst, snap, SCF_PG_STARTD, pg) == -1) {
2329 libscf_read_method_ids(scf_handle_t *h, scf_instance_t *inst, const char *fmri,
2346 if (scf_instance_get_pg(inst, SCF_PG_RESTARTER, pg) == -1) {
2534 libscf_note_method_log(scf_instance_t *inst, const char *dir, const char *file)
2543 h = scf_instance_handle(inst);
2554 ret = libscf_inst_get_or_add_pg(inst, SCF_PG_RESTARTER,
2798 scf_instance_t *inst;
2804 inst = safe_scf_instance_create(h);
2824 while (scf_iter_next_instance(inst_iter, inst) > 0) {
2827 if (libscf_instance_get_fmri(inst, &fmri) == 0) {
2830 err = dgraph_add_instance(fmri, inst, B_TRUE);
2844 scf_instance_destroy(inst);
2857 libscf_get_method(scf_handle_t *h, int type, restarter_inst_t *inst,
2895 if (scf_handle_decode_fmri(h, inst->ri_i.i_fmri, NULL, NULL, scf_inst,
2899 inst->ri_i.i_fmri, scf_strerror(scf_error()));
2924 "from %s/%s\n", inst->ri_i.i_fmri, name, SCF_PROPERTY_EXEC);
2930 log_instance(inst, B_TRUE, "Could not expand method tokens "
2946 log_instance(inst, B_TRUE, "%s/%s is multi-valued or not of "
2996 "astring from %s/%s\n", inst->ri_i.i_fmri,
3077 "from %s/%s\n", inst->ri_i.i_fmri, name,
3112 update_fault_count(restarter_inst_t *inst, int type)
3117 inst->ri_i.i_fault_count++;
3119 inst->ri_i.i_fmri, inst->ri_i.i_fault_count);
3122 inst->ri_i.i_fault_count = 0;
3124 if (inst->ri_i.i_fault_count >= FAULT_THRESHOLD)
3396 * Call cb for each dependency property group of inst. cb is invoked with
3398 * is broken, returns ECONNABORTED. If inst is deleted, returns ECANCELED.
3403 walk_dependency_pgs(scf_instance_t *inst, callback_t cb, void *arg)
3411 h = scf_instance_handle(inst);
3416 snap = libscf_get_running_snapshot(inst);
3418 if (scf_iter_instance_pgs_typed_composed(iter, inst, snap,
3588 scf_instance_t *inst;
3604 inst = safe_scf_instance_create(h);
3680 if (scf_service_add_instance(svc, startd_inst, inst) != 0) {
3754 ret = libscf_inst_set_boolean_prop(inst, SCF_PG_GENERAL,
3771 ret = libscf_write_start_pid(inst, getpid());
3791 ret = libscf_inst_set_count_prop(inst,
3811 ret = libscf_note_method_log(inst, LOG_PREFIX_EARLY,
3814 ret = libscf_note_method_log(inst, LOG_PREFIX_NORMAL,
3835 scf_instance_destroy(inst);
3853 scf_instance_t *inst;
3858 inst = safe_scf_instance_create(h);
3863 inst, NULL, NULL, SCF_DECODE_FMRI_EXACT) == -1) {
3881 ret = libscf_inst_set_boolean_prop(inst, "system", SCF_GROUP_FRAMEWORK,
3904 scf_instance_destroy(inst);
3910 * Set inst->ri_m_inst to the scf instance for inst. If it has been deleted,
3911 * set inst->ri_mi_deleted to true. If the repository connection is broken, it
3915 libscf_reget_instance(restarter_inst_t *inst)
3920 h = scf_instance_handle(inst->ri_m_inst);
3923 r = libscf_lookup_instance(inst->ri_i.i_fmri, inst->ri_m_inst);
3927 inst->ri_mi_deleted = (r == ENOENT);