Lines Matching defs:pg

38  * are allocated by the callers through scf_tmpl_[pg|prop]_create(), and
39 * destroyed with scf_tmpl_[pg|prop]_destroy(). They are populated by
58 * followed by pg and prop template discovery functions, followed
220 _scf_get_pg_type(scf_propertygroup_t *pg)
227 } else if (scf_pg_get_type(pg, buf, sz) == -1) {
304 * Reads a single value from the pg and property name specified. On success,
323 * Property group specified by pg is not set.
327 _read_single_value_from_pg(scf_propertygroup_t *pg, const char *prop_name,
335 if ((h = scf_pg_handle(pg)) == NULL) {
348 if (scf_pg_get_property(pg, prop_name, prop) != 0) {
374 * Reads an astring from the pg and property name specified. On success,
393 * The property group specified by pg is not set.
398 _scf_read_single_astring_from_pg(scf_propertygroup_t *pg, const char *prop_name)
405 if (_read_single_value_from_pg(pg, prop_name, &val) == -1)
466 * Reads a boolean from the pg and property name specified.
484 * The property group specified by pg is not set.
489 _read_single_boolean_from_pg(scf_propertygroup_t *pg, const char *prop_name,
495 if (_read_single_value_from_pg(pg, prop_name, &val) == -1)
510 * This function reads the values from the property prop_name in pg and
531 _append_astrings_values(scf_propertygroup_t *pg, const char *prop_name,
560 if ((h = scf_pg_handle(pg)) == NULL) {
574 if (scf_pg_get_property(pg, prop_name, prop) != 0) {
682 _read_astrings_values(scf_propertygroup_t *pg, const char *prop_name,
689 return (_append_astrings_values(pg, prop_name, vals));
744 * char *_tmpl_pg_name(pg, type, use_type)
746 * pg and type can both be NULL. Returns the name of the most specific
748 * If use_type is set and pg is not NULL, a property group name for a
759 _tmpl_pg_name(const char *pg, const char *type, int use_type)
771 if (pg == NULL && type == NULL) {
778 } else if (pg != NULL && type != NULL) {
780 SCF_PG_TM_PG_PATTERN_NT_PREFIX, pg);
781 } else if (pg != NULL && type == NULL && use_type == 1) {
783 SCF_PG_TM_PG_PATTERN_NT_PREFIX, pg);
784 } else if (pg != NULL && type == NULL) {
786 SCF_PG_TM_PG_PATTERN_N_PREFIX, pg);
787 } else if (type != NULL && pg == NULL) {
813 _scf_get_pg_name(scf_propertygroup_t *pg)
820 } else if (scf_pg_get_name(pg, buf, sz) == -1) {
990 scf_propertygroup_t *pg = NULL;
997 (pg = scf_pg_create(h)) == NULL) {
1004 pg);
1006 ret = scf_service_get_pg(svc, SCF_PG_GENERAL, pg);
1030 restarter = _scf_read_single_astring_from_pg(pg,
1085 scf_pg_destroy(pg);
1092 scf_pg_destroy(pg);
1317 const scf_snapshot_t *snap, const char *name, scf_propertygroup_t *pg)
1323 assert(pg != NULL);
1326 ret = scf_instance_get_pg_composed(inst, snap, name, pg);
1328 ret = scf_service_get_pg(svc, name, pg);
1336 * On error, destroy pg and set it to NULL.
1344 const scf_snapshot_t *snap, const char *name, scf_propertygroup_t *pg)
1348 ret = _get_pg(svc, inst, snap, name, pg);
1364 scf_pg_destroy(pg);
1365 pg = NULL;
1383 * _NOT_SET (property group specified by pg is not set), _PERMISSION_DENIED,
1388 check_target_match(scf_propertygroup_t *pg, const char *target)
1393 pg_target = _scf_read_single_astring_from_pg(pg,
1480 scf_propertygroup_t *pg = NULL;
1496 if ((pg = scf_pg_create(h)) == NULL ||
1499 scf_pg_destroy(pg);
1504 * We're going to walk through the possible pg templates that
1514 ret = _lookup_pg(svc, inst, snap, *tmpl_pg_name, pg);
1516 if (pg != NULL) {
1517 if ((r = check_target_match(pg, target)) == 0)
1535 ret = _lookup_pg(svc, inst, snap, *tmpl_pg_name, pg);
1537 if (pg != NULL) {
1538 if ((r = check_target_match(pg, target)) == 0)
1566 while ((ret = scf_iter_next_pg(iter, pg)) == 1) {
1567 /* Make sure this is a name and type specified pg. */
1568 name = _scf_read_single_astring_from_pg(pg,
1572 type = _scf_read_single_astring_from_pg(pg,
1579 check_target_match(pg, target) == 0) {
1600 ret = _lookup_pg(svc, inst, snap, *tmpl_pg_name, pg);
1602 if (pg != NULL) {
1603 if ((r = check_target_match(pg, target)) == 0)
1616 ret = _lookup_pg(svc, inst, snap, *tmpl_pg_name, pg);
1618 if (pg != NULL) {
1619 if ((r = check_target_match(pg, target)) == 0)
1630 scf_pg_destroy(pg);
1634 pg = NULL;
1639 return (pg);
1643 * Finds the pg match in either the supplied service or instance.
1667 scf_propertygroup_t *pg;
1685 pg = _find_template_pg_match(svc, inst, tmpl_snap, p->pw_pgname,
1688 if (pg != NULL) {
1690 p->pw_pg = pg;
1709 * FMRI argument, snapshot name, pg_name, or pg is invalid.
1717 scf_tmpl_get_by_pg(scf_propertygroup_t *pg, scf_pg_tmpl_t *pg_tmpl, int flags)
1735 if ((h = scf_pg_handle(pg)) == NULL)
1752 if (scf_pg_get_name(pg, pg_name, nbufsz) < 0) {
1756 if (scf_pg_get_type(pg, pg_type, tbufsz) < 0) {
1762 ret = scf_pg_get_parent_snaplevel(pg, snaplvl);
1834 ret = scf_pg_get_parent_instance(pg, inst);
1842 ret = scf_pg_get_parent_service(pg, svc);
2219 * Retrieves name or type of a template pg.
2234 _scf_tmpl_prop_value(scf_propertygroup_t *pg, const char *pname, char **out)
2239 *out = _scf_read_single_astring_from_pg(pg, pname);
2302 scf_propertygroup_t *pg = NULL;
2321 (pg = scf_pg_create(h)) == NULL) {
2391 pg_tmpl->pt_pg = pg;
2518 scf_pg_destroy(pg);
2598 scf_propertygroup_t *pg = NULL;
2608 if ((pg = scf_pg_create(scf_pg_handle(t->pt_pg))) == NULL)
2618 tmpl_prop_name, pg) != 0) {
2637 if ((pg_type = _scf_get_pg_type(pg)) != NULL &&
2648 scf_pg_destroy(pg);
2655 prop_tmpl->prt_pg = pg;
2723 scf_propertygroup_t *pg = NULL;
2744 if ((pg = scf_pg_create(h)) == NULL ||
2774 prop_tmpl->prt_pg = pg;
2865 scf_pg_destroy(pg);
2942 _read_localized_astring_from_pg(scf_propertygroup_t *pg, const char *name,
2951 lname_prop = _scf_read_single_astring_from_pg(pg, str);
2959 lname_prop = _scf_read_single_astring_from_pg(pg, str);
3689 _check_choices_include_values(scf_propertygroup_t *pg, const char *name)
3695 if ((ret = _read_astrings_values(pg,
5084 scf_propertygroup_t *pg)
5095 if ((pg_name = _scf_get_pg_name(pg)) == NULL)
5097 if ((actual = _scf_get_pg_type(pg)) == NULL)
5138 scf_propertygroup_t *pg, const scf_prop_tmpl_t *pt)
5150 if ((pg_name = _scf_get_pg_name(pg)) == NULL)
5208 scf_propertygroup_t *pg, const scf_prop_tmpl_t *pt, scf_property_t *prop)
5222 if ((pg_name = _scf_get_pg_name(pg)) == NULL)
5286 scf_propertygroup_t *pg, const scf_prop_tmpl_t *pt, scf_property_t *prop,
5305 if ((pg_name = _scf_get_pg_name(pg)) == NULL)
5395 scf_propertygroup_t *pg, const scf_prop_tmpl_t *pt, scf_property_t *prop,
5412 if ((pg_name = _scf_get_pg_name(pg)) == NULL)
5486 scf_propertygroup_t *pg, const scf_prop_tmpl_t *pt, scf_property_t *prop,
5505 if ((pg_name = _scf_get_pg_name(pg)) == NULL)
5672 * error is appended to "errs". pg and prop, if supplied, are used to
5689 _value_in_constraint(scf_propertygroup_t *pg, scf_property_t *prop,
5720 if (pg == NULL && prop == NULL) {
5831 * pg and prop are provided, we know we're
5836 if (pg == NULL && prop == NULL)
5840 if (_add_tmpl_count_error(errs, terr_type, pg, pt,
5845 if (pg == NULL && prop == NULL)
5849 if (_add_tmpl_int_error(errs, terr_type, pg, pt, prop,
5854 if (pg == NULL && prop == NULL)
5858 if (_add_tmpl_constraint_error(errs, terr_type, pg,
5977 _validate_cardinality(scf_propertygroup_t *pg, scf_prop_tmpl_t *pt,
6040 pg, pt, prop, (uint64_t)count, &min, &max) == -1)
6065 _check_property(scf_prop_tmpl_t *pt, scf_propertygroup_t *pg,
6076 h = scf_pg_handle(pg);
6112 if (_add_tmpl_wrong_prop_type_error(errs, pg, pt,
6131 if (_validate_cardinality(pg, pt, prop, errs) == -1)
6146 if (_value_in_constraint(pg, prop, pt, val, errs) == -1) {
6192 _check_pg(scf_pg_tmpl_t *t, scf_propertygroup_t *pg, char *pg_name,
6208 assert(pg != NULL);
6212 if ((h = scf_pg_handle(pg)) == NULL) {
6250 if (_add_tmpl_wrong_pg_type_error(errs, t, pg) == -1)
6257 if (scf_iter_pg_properties(iter, pg) != 0) {
6286 if (_check_property(pt, pg, prop, errs) != 0)
6320 if (scf_pg_get_property(pg, prop_name, prop) != 0) {
6325 if (_add_tmpl_missing_prop_error(errs, t, pg,
6534 scf_propertygroup_t *pg = NULL;
6549 if ((pg = scf_pg_create(h)) == NULL ||
6616 while ((r = scf_iter_next_pg(iter, pg)) == 1) {
6617 if (scf_pg_get_name(pg, pg_name, nsize) == -1) {
6626 if (scf_pg_get_type(pg, type, rsize) == -1) {
6652 if (_check_pg(t, pg, pg_name, type, *errs) != 0)
6688 if (_get_pg(NULL, inst, snap, pg_name, pg) != 0) {
6736 scf_pg_destroy(pg);