Lines Matching refs:vsc

591 	vs_scfctx_t vsc;  in vs_scf_values_get()  local
596 if ((vs_scf_ctx_open(&vsc)) != 0) { in vs_scf_values_get()
597 vs_scf_ctx_close(&vsc); in vs_scf_values_get()
601 if (scf_instance_get_pg(vsc.vscf_inst, pgname, vsc.vscf_pgroup) == -1) { in vs_scf_values_get()
602 vs_scf_ctx_close(&vsc); in vs_scf_values_get()
623 vsc.vscf_prop[np] = scf_property_create(vsc.vscf_handle); in vs_scf_values_get()
624 vsc.vscf_val[np] = scf_value_create(vsc.vscf_handle); in vs_scf_values_get()
626 if (vsc.vscf_prop[np] == NULL || vsc.vscf_val[np] == NULL) { in vs_scf_values_get()
631 if (scf_pg_get_property(vsc.vscf_pgroup, vpd->vpd_name, in vs_scf_values_get()
632 vsc.vscf_prop[np]) == -1) { in vs_scf_values_get()
641 if ((rc = vs_scf_get(vpd, prop_hd, &vsc, np)) != VS_ERR_NONE) in vs_scf_values_get()
648 vs_scf_ctx_close(&vsc); in vs_scf_values_get()
662 vs_scfctx_t *vsc, int idx) in vs_scf_get() argument
670 if ((rc = scf_property_get_value(vsc->vscf_prop[idx], in vs_scf_get()
671 vsc->vscf_val[idx])) == -1) { in vs_scf_get()
683 if ((scf_value_get_astring(vsc->vscf_val[idx], in vs_scf_get()
689 if ((scf_value_get_boolean(vsc->vscf_val[idx], in vs_scf_get()
696 if ((scf_value_get_astring(vsc->vscf_val[idx], in vs_scf_get()
702 if ((scf_value_get_astring(vsc->vscf_val[idx], in vs_scf_get()
708 if ((scf_value_get_boolean(vsc->vscf_val[idx], in vs_scf_get()
715 (void) scf_value_get_as_string_typed(vsc->vscf_val[idx], in vs_scf_get()
719 if ((scf_value_get_integer(vsc->vscf_val[idx], &port)) == -1) in vs_scf_get()
727 if ((scf_value_get_integer(vsc->vscf_val[idx], in vs_scf_get()
753 vs_scfctx_t vsc; in vs_scf_pg_create() local
759 if (vs_scf_ctx_open(&vsc) != 0) { in vs_scf_pg_create()
760 vs_scf_ctx_close(&vsc); in vs_scf_pg_create()
764 if (scf_instance_add_pg(vsc.vscf_inst, pgname, in vs_scf_pg_create()
765 SCF_GROUP_APPLICATION, 0, vsc.vscf_pgroup) == -1) { in vs_scf_pg_create()
766 vs_scf_ctx_close(&vsc); in vs_scf_pg_create()
771 vs_scf_ctx_close(&vsc); in vs_scf_pg_create()
797 vs_scfctx_t vsc; in vs_scf_pg_delete() local
803 if (vs_scf_ctx_open(&vsc) != 0) { in vs_scf_pg_delete()
804 vs_scf_ctx_close(&vsc); in vs_scf_pg_delete()
808 if (scf_instance_get_pg(vsc.vscf_inst, pgname, vsc.vscf_pgroup) == -1) { in vs_scf_pg_delete()
809 vs_scf_ctx_close(&vsc); in vs_scf_pg_delete()
818 if (scf_pg_delete(vsc.vscf_pgroup) == -1) { in vs_scf_pg_delete()
819 vs_scf_ctx_close(&vsc); in vs_scf_pg_delete()
828 vs_scf_ctx_close(&vsc); in vs_scf_pg_delete()
858 vs_scfctx_t vsc; in vs_scf_values_set() local
864 if (vs_scf_ctx_open(&vsc) != 0) { in vs_scf_values_set()
865 vs_scf_ctx_close(&vsc); in vs_scf_values_set()
869 if (scf_instance_get_pg(vsc.vscf_inst, pgname, vsc.vscf_pgroup) == -1) { in vs_scf_values_set()
870 vs_scf_ctx_close(&vsc); in vs_scf_values_set()
880 if (((vsc.vscf_tx = scf_transaction_create(vsc.vscf_handle)) == NULL) || in vs_scf_values_set()
881 (scf_transaction_start(vsc.vscf_tx, vsc.vscf_pgroup) == -1)) { in vs_scf_values_set()
882 vs_scf_ctx_close(&vsc); in vs_scf_values_set()
898 vsc.vscf_val[np] = scf_value_create(vsc.vscf_handle); in vs_scf_values_set()
899 vsc.vscf_ent[np] = scf_entry_create(vsc.vscf_handle); in vs_scf_values_set()
901 if (vsc.vscf_val[np] == NULL || vsc.vscf_ent[np] == NULL) { in vs_scf_values_set()
906 if ((rc = scf_transaction_property_change(vsc.vscf_tx, in vs_scf_values_set()
907 vsc.vscf_ent[np], vpd->vpd_name, vpd->vpd_type)) == -1) { in vs_scf_values_set()
908 rc = scf_transaction_property_new(vsc.vscf_tx, in vs_scf_values_set()
909 vsc.vscf_ent[np], vpd->vpd_name, vpd->vpd_type); in vs_scf_values_set()
916 if ((rc = vs_scf_set(vpd, prop_hd, &vsc, np)) != VS_ERR_NONE) in vs_scf_values_set()
923 vs_scf_ctx_close(&vsc); in vs_scf_values_set()
928 if (scf_transaction_commit(vsc.vscf_tx) == -1) { in vs_scf_values_set()
929 vs_scf_ctx_close(&vsc); in vs_scf_values_set()
932 vs_scf_ctx_close(&vsc); in vs_scf_values_set()
953 vs_scfctx_t *vsc, int idx) in vs_scf_set() argument
965 if ((scf_value_set_astring(vsc->vscf_val[idx], in vs_scf_set()
971 scf_value_set_boolean(vsc->vscf_val[idx], in vs_scf_set()
975 if ((scf_value_set_astring(vsc->vscf_val[idx], in vs_scf_set()
981 scf_value_set_boolean(vsc->vscf_val[idx], in vs_scf_set()
985 if ((scf_value_set_from_string(vsc->vscf_val[idx], in vs_scf_set()
991 scf_value_set_integer(vsc->vscf_val[idx], vep->vep_port); in vs_scf_set()
994 scf_value_set_integer(vsc->vscf_val[idx], in vs_scf_set()
998 if ((scf_value_set_astring(vsc->vscf_val[idx], in vs_scf_set()
1007 if ((scf_entry_add_value(vsc->vscf_ent[idx], in vs_scf_set()
1008 vsc->vscf_val[idx])) == -1) { in vs_scf_set()
1028 vs_scf_ctx_open(vs_scfctx_t *vsc) in vs_scf_ctx_open() argument
1030 (void) memset(vsc, 0, sizeof (vs_scfctx_t)); in vs_scf_ctx_open()
1032 if ((vsc->vscf_handle = scf_handle_create(SCF_VERSION)) == NULL) in vs_scf_ctx_open()
1035 if (scf_handle_bind(vsc->vscf_handle) == -1) in vs_scf_ctx_open()
1038 if ((vsc->vscf_inst = scf_instance_create(vsc->vscf_handle)) == NULL) in vs_scf_ctx_open()
1041 if (scf_handle_decode_fmri(vsc->vscf_handle, VS_INSTANCE_FMRI, in vs_scf_ctx_open()
1042 NULL, NULL, vsc->vscf_inst, NULL, NULL, in vs_scf_ctx_open()
1047 if ((vsc->vscf_pgroup = scf_pg_create(vsc->vscf_handle)) == NULL) in vs_scf_ctx_open()
1060 vs_scf_ctx_close(vs_scfctx_t *vsc) in vs_scf_ctx_close() argument
1065 if (vsc->vscf_val[i]) in vs_scf_ctx_close()
1066 scf_value_destroy(vsc->vscf_val[i]); in vs_scf_ctx_close()
1067 if (vsc->vscf_ent[i]) in vs_scf_ctx_close()
1068 scf_entry_destroy(vsc->vscf_ent[i]); in vs_scf_ctx_close()
1069 if (vsc->vscf_prop[i]) in vs_scf_ctx_close()
1070 scf_property_destroy(vsc->vscf_prop[i]); in vs_scf_ctx_close()
1073 if (vsc->vscf_iter) in vs_scf_ctx_close()
1074 scf_iter_destroy(vsc->vscf_iter); in vs_scf_ctx_close()
1075 if (vsc->vscf_tx) in vs_scf_ctx_close()
1076 scf_transaction_destroy(vsc->vscf_tx); in vs_scf_ctx_close()
1077 if (vsc->vscf_pgroup) in vs_scf_ctx_close()
1078 scf_pg_destroy(vsc->vscf_pgroup); in vs_scf_ctx_close()
1079 if (vsc->vscf_inst) in vs_scf_ctx_close()
1080 scf_instance_destroy(vsc->vscf_inst); in vs_scf_ctx_close()
1081 if (vsc->vscf_handle) in vs_scf_ctx_close()
1082 scf_handle_destroy(vsc->vscf_handle); in vs_scf_ctx_close()
1490 vs_scfctx_t vsc; in vs_props_get_engines() local
1493 if (((vs_scf_ctx_open(&vsc)) != 0) || in vs_props_get_engines()
1494 ((vsc.vscf_iter = scf_iter_create(vsc.vscf_handle)) == NULL) || in vs_props_get_engines()
1495 (scf_iter_instance_pgs_typed(vsc.vscf_iter, vsc.vscf_inst, in vs_props_get_engines()
1497 vs_scf_ctx_close(&vsc); in vs_props_get_engines()
1508 (scf_iter_next_pg(vsc.vscf_iter, vsc.vscf_pgroup) == 1)) { in vs_props_get_engines()
1509 if (scf_pg_get_name(vsc.vscf_pgroup, pgname, in vs_props_get_engines()
1511 vs_scf_ctx_close(&vsc); in vs_props_get_engines()
1522 vs_scf_ctx_close(&vsc); in vs_props_get_engines()
1536 vs_scfctx_t vsc; in vs_scf_pg_count() local
1538 if ((vs_scf_ctx_open(&vsc) != 0) || in vs_scf_pg_count()
1539 ((vsc.vscf_iter = scf_iter_create(vsc.vscf_handle)) == NULL) || in vs_scf_pg_count()
1540 (scf_iter_instance_pgs_typed(vsc.vscf_iter, vsc.vscf_inst, in vs_scf_pg_count()
1542 vs_scf_ctx_close(&vsc); in vs_scf_pg_count()
1546 while (scf_iter_next_pg(vsc.vscf_iter, vsc.vscf_pgroup) == 1) in vs_scf_pg_count()
1549 vs_scf_ctx_close(&vsc); in vs_scf_pg_count()