Lines Matching refs:conf
173 pool_conf_status(const pool_conf_t *conf) in pool_conf_status() argument
175 return (conf->pc_state); in pool_conf_status()
184 pool_conf_t *conf; in pool_set_binding() local
187 if ((conf = pool_conf_alloc()) == NULL) in pool_set_binding()
190 if (pool_conf_open(conf, pool_dynamic_location(), PO_RDONLY) < 0) { in pool_set_binding()
191 pool_conf_free(conf); in pool_set_binding()
196 result = conf->pc_prov->pc_set_binding(conf, pool_name, idtype, id); in pool_set_binding()
198 (void) pool_conf_close(conf); in pool_set_binding()
199 pool_conf_free(conf); in pool_set_binding()
210 pool_conf_t *conf; in pool_get_resource_binding() local
220 if ((conf = pool_conf_alloc()) == NULL) in pool_get_resource_binding()
223 if (pool_conf_open(conf, pool_dynamic_location(), PO_RDONLY) in pool_get_resource_binding()
226 pool_conf_free(conf); in pool_get_resource_binding()
229 result = conf->pc_prov->pc_get_resource_binding(conf, type, pid); in pool_get_resource_binding()
230 (void) pool_conf_close(conf); in pool_get_resource_binding()
231 pool_conf_free(conf); in pool_get_resource_binding()
242 pool_conf_t *conf; in pool_get_binding() local
245 if ((conf = pool_conf_alloc()) == NULL) in pool_get_binding()
248 if (pool_conf_open(conf, pool_dynamic_location(), PO_RDONLY) in pool_get_binding()
251 pool_conf_free(conf); in pool_get_binding()
254 result = conf->pc_prov->pc_get_binding(conf, pid); in pool_get_binding()
255 (void) pool_conf_close(conf); in pool_get_binding()
256 pool_conf_free(conf); in pool_get_binding()
337 pool_conf_t *conf = TO_CONF(pe); in pool_base_info() local
370 if (pool_walk_properties(conf, (pool_elem_t *)pe, cb, in pool_base_info()
384 if ((rs = pool_query_pool_resources(conf, pool_elem_pool(pe), in pool_base_info()
425 if ((ps = pool_query_pools(conf, &nelem, NULL)) != in pool_base_info()
437 if ((rs = pool_query_resources(conf, &nelem, NULL)) != in pool_base_info()
451 if ((rs = pool_query_pool_resources(conf, in pool_base_info()
464 if ((cs = pool_query_resource_components(conf, in pool_base_info()
499 pool_info(const pool_conf_t *conf, const pool_t *pool, int deep) in pool_info() argument
505 if (TO_CONF(pe) != conf) { in pool_info()
510 if (pool_conf_status(conf) == POF_INVALID || (deep & ~1)) { in pool_info()
527 pool_resource_info(const pool_conf_t *conf, const pool_resource_t *res, in pool_resource_info() argument
534 if (TO_CONF(pe) != conf) { in pool_resource_info()
539 if (pool_conf_status(conf) == POF_INVALID || (deep & ~1)) { in pool_resource_info()
556 pool_component_info(const pool_conf_t *conf, const pool_component_t *comp, in pool_component_info() argument
563 if (TO_CONF(pe) != conf) { in pool_component_info()
568 if (pool_conf_status(conf) == POF_INVALID || (deep & ~1)) { in pool_component_info()
585 pool_conf_info(const pool_conf_t *conf, int deep) in pool_conf_info() argument
589 if (pool_conf_status(conf) == POF_INVALID || (deep & ~1)) { in pool_conf_info()
593 if ((pe = pool_conf_to_elem(conf)) == NULL) { in pool_conf_info()
854 pool_get_property(const pool_conf_t *conf, const pool_elem_t *pe, in pool_get_property() argument
859 if (pool_conf_status(conf) == POF_INVALID) { in pool_get_property()
914 pool_put_property(pool_conf_t *conf, pool_elem_t *pe, const char *name, in pool_put_property() argument
919 if (pool_conf_check(conf) != PO_SUCCESS) in pool_put_property()
922 if (TO_CONF(pe) != conf) { in pool_put_property()
979 pool_set_temporary(pool_conf_t *conf, pool_elem_t *pe) in pool_set_temporary() argument
985 if (pool_conf_check(conf) != PO_SUCCESS) in pool_set_temporary()
988 if (TO_CONF(pe) != conf) { in pool_set_temporary()
1095 pool_rm_property(pool_conf_t *conf, pool_elem_t *pe, const char *name) in pool_rm_property() argument
1099 if (pool_conf_check(conf) != PO_SUCCESS) in pool_rm_property()
1102 if (TO_CONF(pe) != conf) { in pool_rm_property()
1162 pool_create(pool_conf_t *conf, const char *name) in pool_create() argument
1168 if (pool_conf_check(conf) != PO_SUCCESS) in pool_create()
1171 if (!is_valid_name(name) || pool_get_pool(conf, name) != NULL) { in pool_create()
1178 if ((pe = conf->pc_prov->pc_elem_create(conf, PEC_POOL, PREC_INVALID, in pool_create()
1190 (void) pool_destroy(conf, pool_elem_pool(pe)); in pool_create()
1196 (void) pool_destroy(conf, pool_elem_pool(pe)); in pool_create()
1200 if (pool_put_property(conf, pe, "pool.name", &val) == PO_FAIL) { in pool_create()
1201 (void) pool_destroy(conf, pool_elem_pool(pe)); in pool_create()
1209 if (conf->pc_prov->pc_oflags & PO_TEMP) { in pool_create()
1210 if (pool_set_temporary(conf, pe) == PO_FAIL) { in pool_create()
1211 (void) pool_destroy(conf, pool_elem_pool(pe)); in pool_create()
1223 pool_resource_create(pool_conf_t *conf, const char *sz_type, const char *name) in pool_resource_create() argument
1235 if (pool_conf_check(conf) != PO_SUCCESS) in pool_resource_create()
1249 if (!is_valid_name(name) || pool_get_resource(conf, sz_type, name) != in pool_resource_create()
1265 if ((resources = pool_query_resources(conf, &nelem, props)) == NULL) { in pool_resource_create()
1286 if ((pe = conf->pc_prov->pc_elem_create(conf, elem_class, type, in pool_resource_create()
1302 (void) pool_resource_destroy(conf, in pool_resource_create()
1310 (void) pool_resource_destroy(conf, pool_elem_res(pe)); in pool_resource_create()
1317 (void) pool_resource_destroy(conf, pool_elem_res(pe)); in pool_resource_create()
1325 if (conf->pc_prov->pc_oflags & PO_TEMP) { in pool_resource_create()
1326 if (pool_set_temporary(conf, pe) != PO_SUCCESS) { in pool_resource_create()
1327 (void) pool_resource_destroy(conf, pool_elem_res(pe)); in pool_resource_create()
1339 pool_component_create(pool_conf_t *conf, const pool_resource_t *res, in pool_component_create() argument
1347 if ((pe = conf->pc_prov->pc_elem_create(conf, PEC_COMP, in pool_component_create()
1407 pool_conf_location(const pool_conf_t *conf) in pool_conf_location() argument
1409 if (pool_conf_status(conf) == POF_INVALID) { in pool_conf_location()
1413 return (conf->pc_location); in pool_conf_location()
1420 pool_conf_close(pool_conf_t *conf) in pool_conf_close() argument
1424 if (pool_conf_status(conf) == POF_INVALID) { in pool_conf_close()
1428 rv = conf->pc_prov->pc_close(conf); in pool_conf_close()
1429 conf->pc_prov = NULL; in pool_conf_close()
1430 free((void *)conf->pc_location); in pool_conf_close()
1431 conf->pc_location = NULL; in pool_conf_close()
1432 conf->pc_state = POF_INVALID; in pool_conf_close()
1442 pool_conf_remove(pool_conf_t *conf) in pool_conf_remove() argument
1446 if (pool_conf_status(conf) == POF_INVALID) { in pool_conf_remove()
1450 rv = conf->pc_prov->pc_remove(conf); in pool_conf_remove()
1451 conf->pc_state = POF_INVALID; in pool_conf_remove()
1461 pool_conf_t *conf; in pool_conf_alloc() local
1463 if ((conf = calloc(1, sizeof (pool_conf_t))) == NULL) { in pool_conf_alloc()
1467 conf->pc_state = POF_INVALID; in pool_conf_alloc()
1468 return (conf); in pool_conf_alloc()
1475 pool_conf_free(pool_conf_t *conf) in pool_conf_free() argument
1477 free(conf); in pool_conf_free()
1485 pool_conf_open(pool_conf_t *conf, const char *location, int oflags) in pool_conf_open() argument
1494 if (pool_conf_status(conf) != POF_INVALID) { in pool_conf_open()
1518 if ((conf->pc_location = strdup(location)) == NULL) { in pool_conf_open()
1536 if (pool_knl_connection_alloc(conf, PO_TEMP) != PO_SUCCESS) { in pool_conf_open()
1537 conf->pc_state = POF_INVALID; in pool_conf_open()
1541 conf->pc_prov->pc_oflags |= PO_RDWR; in pool_conf_open()
1544 if (pool_knl_connection_alloc(conf, oflags) != PO_SUCCESS) { in pool_conf_open()
1545 conf->pc_state = POF_INVALID; in pool_conf_open()
1549 if (pool_xml_connection_alloc(conf, oflags) != PO_SUCCESS) { in pool_conf_open()
1550 conf->pc_state = POF_INVALID; in pool_conf_open()
1562 pool_conf_rollback(pool_conf_t *conf) in pool_conf_rollback() argument
1564 if (pool_conf_status(conf) == POF_INVALID) { in pool_conf_rollback()
1568 return (conf->pc_prov->pc_rollback(conf)); in pool_conf_rollback()
1579 pool_conf_commit(pool_conf_t *conf, int active) in pool_conf_commit() argument
1583 if (pool_conf_status(conf) == POF_INVALID) { in pool_conf_commit()
1590 if (conf_is_dynamic(conf) == PO_TRUE) { in pool_conf_commit()
1601 oflags = conf->pc_prov->pc_oflags; in pool_conf_commit()
1602 conf->pc_prov->pc_oflags |= PO_RDWR; in pool_conf_commit()
1603 retval = pool_conf_commit_sys(conf, active); in pool_conf_commit()
1604 conf->pc_prov->pc_oflags = oflags; in pool_conf_commit()
1609 retval = conf->pc_prov->pc_commit(conf); in pool_conf_commit()
1619 pool_conf_export(const pool_conf_t *conf, const char *location, in pool_conf_export() argument
1622 if (pool_conf_status(conf) == POF_INVALID) { in pool_conf_export()
1626 return (conf->pc_prov->pc_export(conf, location, fmt)); in pool_conf_export()
1634 pool_conf_validate(const pool_conf_t *conf, pool_valid_level_t level) in pool_conf_validate() argument
1636 if (pool_conf_status(conf) == POF_INVALID) { in pool_conf_validate()
1640 return (conf->pc_prov->pc_validate(conf, level)); in pool_conf_validate()
1648 pool_conf_update(const pool_conf_t *conf, int *changed) in pool_conf_update() argument
1650 if (pool_conf_status(conf) == POF_INVALID || in pool_conf_update()
1651 conf_is_dynamic(conf) == PO_FALSE) { in pool_conf_update()
1663 return (pool_knl_update((pool_conf_t *)conf, changed)); in pool_conf_update()
1672 pool_walk_properties(pool_conf_t *conf, pool_elem_t *elem, void *arg, in pool_walk_properties() argument
1676 return (pool_walk_any_properties(conf, elem, arg, prop_callback, 0)); in pool_walk_properties()
1698 pool_walk_any_properties(pool_conf_t *conf, pool_elem_t *elem, void *arg, in pool_walk_any_properties() argument
1707 if (pool_conf_status(conf) == POF_INVALID) { in pool_walk_any_properties()
1745 if (prop_callback(conf, elem, props[i].pp_pname, in pool_walk_any_properties()
1779 if (prop_callback(conf, elem, props[i].pp_pname, in pool_walk_any_properties()
1796 if (prop_callback(conf, elem, name, pvals[i], in pool_walk_any_properties()
1816 pool_get_pool(const pool_conf_t *conf, const char *name) in pool_get_pool() argument
1826 if (pool_conf_status(conf) == POF_INVALID) { in pool_get_pool()
1835 rs = pool_query_pools(conf, &size, props); in pool_get_pool()
1856 pool_query_pools(const pool_conf_t *conf, uint_t *size, pool_value_t **props) in pool_query_pools() argument
1863 if (pool_conf_status(conf) == POF_INVALID) { in pool_query_pools()
1867 rs = pool_exec_query(conf, NULL, NULL, PEC_QRY_POOL, props); in pool_query_pools()
1899 pool_get_resource(const pool_conf_t *conf, const char *sz_type, in pool_get_resource() argument
1910 if (pool_conf_status(conf) == POF_INVALID) { in pool_get_resource()
1943 rs = pool_query_resources(conf, &size, props); in pool_get_resource()
1964 pool_query_resources(const pool_conf_t *conf, uint_t *size, in pool_query_resources() argument
1972 if (pool_conf_status(conf) == POF_INVALID) { in pool_query_resources()
1979 rs = pool_exec_query(conf, NULL, NULL, PEC_QRY_RES, props); in pool_query_resources()
2015 pool_query_components(const pool_conf_t *conf, uint_t *size, in pool_query_components() argument
2018 return (pool_query_resource_components(conf, NULL, size, props)); in pool_query_components()
2027 pool_destroy(pool_conf_t *conf, pool_t *pp) in pool_destroy() argument
2031 if (pool_conf_check(conf) != PO_SUCCESS) in pool_destroy()
2054 pool_resource_destroy(pool_conf_t *conf, pool_resource_t *prs) in pool_resource_destroy() argument
2063 if (pool_conf_check(conf) != PO_SUCCESS) in pool_resource_destroy()
2076 if ((pl = pool_query_pools(conf, &npool, NULL)) != NULL) { in pool_resource_destroy()
2082 if ((rl = pool_query_pool_resources(conf, pl[i], &nres, in pool_resource_destroy()
2086 if (pool_dissociate(conf, pl[i], in pool_resource_destroy()
2108 if ((rl = pool_query_resource_components(conf, prs, &res_size, in pool_resource_destroy()
2110 int ostate = conf->pc_state; in pool_resource_destroy()
2111 conf->pc_state = POF_DESTROY; in pool_resource_destroy()
2112 if (pool_resource_xtransfer(conf, prs, default_set_res, in pool_resource_destroy()
2115 conf->pc_state = ostate; in pool_resource_destroy()
2118 conf->pc_state = ostate; in pool_resource_destroy()
2160 pool_exec_query(const pool_conf_t *conf, const pool_elem_t *src, in pool_exec_query() argument
2163 return (conf->pc_prov->pc_exec_query(conf, src, src_attr, classes, in pool_exec_query()
2251 pool_conf_t *conf = TO_CONF(TO_ELEM(src)); in choose_components() local
2258 if ((components = pool_query_resource_components(conf, src, &ncomponent, in choose_components()
2272 if (pool_resource_xtransfer(conf, src, dst, moved) == in choose_components()
2286 if (pool_resource_xtransfer(conf, src, dst, moved) == in choose_components()
2309 setup_transfer(pool_conf_t *conf, pool_resource_t *src, pool_resource_t *tgt, in setup_transfer() argument
2315 if (pool_conf_check(conf) != PO_SUCCESS) in setup_transfer()
2346 if (pool_conf_status(conf) != POF_DESTROY) { in setup_transfer()
2352 pool_dprintf("conf is %s\n", pool_conf_location(conf)); in setup_transfer()
2372 pool_resource_transfer(pool_conf_t *conf, pool_resource_t *src, in pool_resource_transfer() argument
2379 if ((ret = setup_transfer(conf, src, tgt, size, &src_size, &tgt_size)) in pool_resource_transfer()
2390 ret = conf->pc_prov->pc_res_xfer(src, tgt, size); in pool_resource_transfer()
2414 pool_resource_xtransfer(pool_conf_t *conf, pool_resource_t *src, in pool_resource_xtransfer() argument
2432 pool_dprintf("in conf %s\n", pool_conf_location(conf)); in pool_resource_xtransfer()
2441 if (pool_get_owning_resource(conf, rl[i]) != src) { in pool_resource_xtransfer()
2449 if ((ret = setup_transfer(conf, src, tgt, size, &src_size, &tgt_size)) in pool_resource_xtransfer()
2453 ret = conf->pc_prov->pc_res_xxfer(src, tgt, rl); in pool_resource_xtransfer()
2482 pool_get_owning_resource(const pool_conf_t *conf, const pool_component_t *comp) in pool_get_owning_resource() argument
2484 if (pool_conf_status(conf) == POF_INVALID) { in pool_get_owning_resource()
2522 pool_conf_to_elem(const pool_conf_t *conf) in pool_conf_to_elem() argument
2526 if (pool_conf_status(conf) == POF_INVALID) { in pool_conf_to_elem()
2530 if ((sys = pool_conf_system(conf)) == NULL) { in pool_conf_to_elem()
2538 pool_to_elem(const pool_conf_t *conf, const pool_t *pp) in pool_to_elem() argument
2540 if (pool_conf_status(conf) == POF_INVALID) { in pool_to_elem()
2548 pool_resource_to_elem(const pool_conf_t *conf, const pool_resource_t *prs) in pool_resource_to_elem() argument
2550 if (pool_conf_status(conf) == POF_INVALID) { in pool_resource_to_elem()
2558 pool_component_to_elem(const pool_conf_t *conf, const pool_component_t *pr) in pool_component_to_elem() argument
2560 if (pool_conf_status(conf) == POF_INVALID) { in pool_component_to_elem()
2572 pool_walk_pools(pool_conf_t *conf, void *arg, in pool_walk_pools() argument
2573 int (*callback)(pool_conf_t *conf, pool_t *pool, void *arg)) in pool_walk_pools() argument
2580 if (pool_conf_status(conf) == POF_INVALID) { in pool_walk_pools()
2585 if ((rs = pool_query_pools(conf, &size, NULL)) == NULL) /* None */ in pool_walk_pools()
2588 if (callback(conf, rs[i], arg) != PO_SUCCESS) { in pool_walk_pools()
2601 pool_walk_components(pool_conf_t *conf, pool_resource_t *prs, void *arg, in pool_walk_components() argument
2602 int (*callback)(pool_conf_t *conf, pool_component_t *pr, void *arg)) in pool_walk_components() argument
2609 if (pool_conf_status(conf) == POF_INVALID) { in pool_walk_components()
2614 if ((rs = pool_query_resource_components(conf, prs, &size, NULL)) == in pool_walk_components()
2618 if (callback(conf, rs[i], arg) != PO_SUCCESS) { in pool_walk_components()
2630 pool_query_pool_resources(const pool_conf_t *conf, const pool_t *pp, in pool_query_pool_resources() argument
2638 if (pool_conf_status(conf) == POF_INVALID) { in pool_query_pool_resources()
2645 rs = pool_exec_query(conf, pe, "res", PEC_QRY_RES, props); in pool_query_pool_resources()
2679 pool_walk_resources(pool_conf_t *conf, pool_t *pp, void *arg, in pool_walk_resources() argument
2687 if (pool_conf_status(conf) == POF_INVALID) { in pool_walk_resources()
2691 if ((rs = pool_query_pool_resources(conf, pp, &size, NULL)) == NULL) in pool_walk_resources()
2694 if (callback(conf, rs[i], arg) != PO_SUCCESS) { in pool_walk_resources()
2706 pool_query_resource_components(const pool_conf_t *conf, in pool_query_resource_components() argument
2714 if (pool_conf_status(conf) == POF_INVALID) { in pool_query_resource_components()
2720 rs = pool_exec_query(conf, pe, NULL, PEC_QRY_COMP, props); in pool_query_resource_components()
2775 pool_associate(pool_conf_t *conf, pool_t *pool, const pool_resource_t *res) in pool_associate() argument
2777 if (pool_conf_check(conf) != PO_SUCCESS) in pool_associate()
2789 pool_dissociate(pool_conf_t *conf, pool_t *pool, const pool_resource_t *res) in pool_dissociate() argument
2791 if (pool_conf_check(conf) != PO_SUCCESS) in pool_dissociate()
2930 pool_conf_check(const pool_conf_t *conf) in pool_conf_check() argument
2932 if (pool_conf_status(conf) == POF_INVALID) { in pool_conf_check()
2937 if ((conf->pc_prov->pc_oflags & PO_RDWR) == 0) { in pool_conf_check()