Lines Matching refs:conf
175 pool_conf_status(const pool_conf_t *conf) in pool_conf_status() argument
177 return (conf->pc_state); in pool_conf_status()
186 pool_conf_t *conf; in pool_set_binding() local
189 if ((conf = pool_conf_alloc()) == NULL) in pool_set_binding()
192 if (pool_conf_open(conf, pool_dynamic_location(), PO_RDONLY) < 0) { in pool_set_binding()
193 pool_conf_free(conf); in pool_set_binding()
198 result = conf->pc_prov->pc_set_binding(conf, pool_name, idtype, id); in pool_set_binding()
200 (void) pool_conf_close(conf); in pool_set_binding()
201 pool_conf_free(conf); in pool_set_binding()
212 pool_conf_t *conf; in pool_get_resource_binding() local
222 if ((conf = pool_conf_alloc()) == NULL) in pool_get_resource_binding()
225 if (pool_conf_open(conf, pool_dynamic_location(), PO_RDONLY) in pool_get_resource_binding()
228 pool_conf_free(conf); in pool_get_resource_binding()
231 result = conf->pc_prov->pc_get_resource_binding(conf, type, pid); in pool_get_resource_binding()
232 (void) pool_conf_close(conf); in pool_get_resource_binding()
233 pool_conf_free(conf); in pool_get_resource_binding()
244 pool_conf_t *conf; in pool_get_binding() local
247 if ((conf = pool_conf_alloc()) == NULL) in pool_get_binding()
250 if (pool_conf_open(conf, pool_dynamic_location(), PO_RDONLY) in pool_get_binding()
253 pool_conf_free(conf); in pool_get_binding()
256 result = conf->pc_prov->pc_get_binding(conf, pid); in pool_get_binding()
257 (void) pool_conf_close(conf); in pool_get_binding()
258 pool_conf_free(conf); in pool_get_binding()
339 pool_conf_t *conf = TO_CONF(pe); in pool_base_info() local
372 if (pool_walk_properties(conf, (pool_elem_t *)pe, cb, in pool_base_info()
386 if ((rs = pool_query_pool_resources(conf, pool_elem_pool(pe), in pool_base_info()
427 if ((ps = pool_query_pools(conf, &nelem, NULL)) != in pool_base_info()
439 if ((rs = pool_query_resources(conf, &nelem, NULL)) != in pool_base_info()
453 if ((rs = pool_query_pool_resources(conf, in pool_base_info()
466 if ((cs = pool_query_resource_components(conf, in pool_base_info()
501 pool_info(const pool_conf_t *conf, const pool_t *pool, int deep) in pool_info() argument
507 if (TO_CONF(pe) != conf) { in pool_info()
512 if (pool_conf_status(conf) == POF_INVALID || (deep & ~1)) { in pool_info()
529 pool_resource_info(const pool_conf_t *conf, const pool_resource_t *res, in pool_resource_info() argument
536 if (TO_CONF(pe) != conf) { in pool_resource_info()
541 if (pool_conf_status(conf) == POF_INVALID || (deep & ~1)) { in pool_resource_info()
558 pool_component_info(const pool_conf_t *conf, const pool_component_t *comp, in pool_component_info() argument
565 if (TO_CONF(pe) != conf) { in pool_component_info()
570 if (pool_conf_status(conf) == POF_INVALID || (deep & ~1)) { in pool_component_info()
587 pool_conf_info(const pool_conf_t *conf, int deep) in pool_conf_info() argument
591 if (pool_conf_status(conf) == POF_INVALID || (deep & ~1)) { in pool_conf_info()
595 if ((pe = pool_conf_to_elem(conf)) == NULL) { in pool_conf_info()
856 pool_get_property(const pool_conf_t *conf, const pool_elem_t *pe, in pool_get_property() argument
861 if (pool_conf_status(conf) == POF_INVALID) { in pool_get_property()
916 pool_put_property(pool_conf_t *conf, pool_elem_t *pe, const char *name, in pool_put_property() argument
921 if (pool_conf_check(conf) != PO_SUCCESS) in pool_put_property()
924 if (TO_CONF(pe) != conf) { in pool_put_property()
981 pool_set_temporary(pool_conf_t *conf, pool_elem_t *pe) in pool_set_temporary() argument
987 if (pool_conf_check(conf) != PO_SUCCESS) in pool_set_temporary()
990 if (TO_CONF(pe) != conf) { in pool_set_temporary()
1097 pool_rm_property(pool_conf_t *conf, pool_elem_t *pe, const char *name) in pool_rm_property() argument
1101 if (pool_conf_check(conf) != PO_SUCCESS) in pool_rm_property()
1104 if (TO_CONF(pe) != conf) { in pool_rm_property()
1164 pool_create(pool_conf_t *conf, const char *name) in pool_create() argument
1170 if (pool_conf_check(conf) != PO_SUCCESS) in pool_create()
1173 if (!is_valid_name(name) || pool_get_pool(conf, name) != NULL) { in pool_create()
1180 if ((pe = conf->pc_prov->pc_elem_create(conf, PEC_POOL, PREC_INVALID, in pool_create()
1192 (void) pool_destroy(conf, pool_elem_pool(pe)); in pool_create()
1198 (void) pool_destroy(conf, pool_elem_pool(pe)); in pool_create()
1202 if (pool_put_property(conf, pe, "pool.name", &val) == PO_FAIL) { in pool_create()
1203 (void) pool_destroy(conf, pool_elem_pool(pe)); in pool_create()
1211 if (conf->pc_prov->pc_oflags & PO_TEMP) { in pool_create()
1212 if (pool_set_temporary(conf, pe) == PO_FAIL) { in pool_create()
1213 (void) pool_destroy(conf, pool_elem_pool(pe)); in pool_create()
1225 pool_resource_create(pool_conf_t *conf, const char *sz_type, const char *name) in pool_resource_create() argument
1237 if (pool_conf_check(conf) != PO_SUCCESS) in pool_resource_create()
1251 if (!is_valid_name(name) || pool_get_resource(conf, sz_type, name) != in pool_resource_create()
1267 if ((resources = pool_query_resources(conf, &nelem, props)) == NULL) { in pool_resource_create()
1288 if ((pe = conf->pc_prov->pc_elem_create(conf, elem_class, type, in pool_resource_create()
1304 (void) pool_resource_destroy(conf, in pool_resource_create()
1312 (void) pool_resource_destroy(conf, pool_elem_res(pe)); in pool_resource_create()
1319 (void) pool_resource_destroy(conf, pool_elem_res(pe)); in pool_resource_create()
1327 if (conf->pc_prov->pc_oflags & PO_TEMP) { in pool_resource_create()
1328 if (pool_set_temporary(conf, pe) != PO_SUCCESS) { in pool_resource_create()
1329 (void) pool_resource_destroy(conf, pool_elem_res(pe)); in pool_resource_create()
1341 pool_component_create(pool_conf_t *conf, const pool_resource_t *res, in pool_component_create() argument
1349 if ((pe = conf->pc_prov->pc_elem_create(conf, PEC_COMP, in pool_component_create()
1409 pool_conf_location(const pool_conf_t *conf) in pool_conf_location() argument
1411 if (pool_conf_status(conf) == POF_INVALID) { in pool_conf_location()
1415 return (conf->pc_location); in pool_conf_location()
1422 pool_conf_close(pool_conf_t *conf) in pool_conf_close() argument
1426 if (pool_conf_status(conf) == POF_INVALID) { in pool_conf_close()
1430 rv = conf->pc_prov->pc_close(conf); in pool_conf_close()
1431 conf->pc_prov = NULL; in pool_conf_close()
1432 free((void *)conf->pc_location); in pool_conf_close()
1433 conf->pc_location = NULL; in pool_conf_close()
1434 conf->pc_state = POF_INVALID; in pool_conf_close()
1444 pool_conf_remove(pool_conf_t *conf) in pool_conf_remove() argument
1448 if (pool_conf_status(conf) == POF_INVALID) { in pool_conf_remove()
1452 rv = conf->pc_prov->pc_remove(conf); in pool_conf_remove()
1453 conf->pc_state = POF_INVALID; in pool_conf_remove()
1463 pool_conf_t *conf; in pool_conf_alloc() local
1465 if ((conf = calloc(1, sizeof (pool_conf_t))) == NULL) { in pool_conf_alloc()
1469 conf->pc_state = POF_INVALID; in pool_conf_alloc()
1470 return (conf); in pool_conf_alloc()
1477 pool_conf_free(pool_conf_t *conf) in pool_conf_free() argument
1479 free(conf); in pool_conf_free()
1487 pool_conf_open(pool_conf_t *conf, const char *location, int oflags) in pool_conf_open() argument
1496 if (pool_conf_status(conf) != POF_INVALID) { in pool_conf_open()
1520 if ((conf->pc_location = strdup(location)) == NULL) { in pool_conf_open()
1538 if (pool_knl_connection_alloc(conf, PO_TEMP) != PO_SUCCESS) { in pool_conf_open()
1539 conf->pc_state = POF_INVALID; in pool_conf_open()
1543 conf->pc_prov->pc_oflags |= PO_RDWR; in pool_conf_open()
1546 if (pool_knl_connection_alloc(conf, oflags) != PO_SUCCESS) { in pool_conf_open()
1547 conf->pc_state = POF_INVALID; in pool_conf_open()
1551 if (pool_xml_connection_alloc(conf, oflags) != PO_SUCCESS) { in pool_conf_open()
1552 conf->pc_state = POF_INVALID; in pool_conf_open()
1564 pool_conf_rollback(pool_conf_t *conf) in pool_conf_rollback() argument
1566 if (pool_conf_status(conf) == POF_INVALID) { in pool_conf_rollback()
1570 return (conf->pc_prov->pc_rollback(conf)); in pool_conf_rollback()
1581 pool_conf_commit(pool_conf_t *conf, int active) in pool_conf_commit() argument
1585 if (pool_conf_status(conf) == POF_INVALID) { in pool_conf_commit()
1592 if (conf_is_dynamic(conf) == PO_TRUE) { in pool_conf_commit()
1603 oflags = conf->pc_prov->pc_oflags; in pool_conf_commit()
1604 conf->pc_prov->pc_oflags |= PO_RDWR; in pool_conf_commit()
1605 retval = pool_conf_commit_sys(conf, active); in pool_conf_commit()
1606 conf->pc_prov->pc_oflags = oflags; in pool_conf_commit()
1611 retval = conf->pc_prov->pc_commit(conf); in pool_conf_commit()
1621 pool_conf_export(const pool_conf_t *conf, const char *location, in pool_conf_export() argument
1624 if (pool_conf_status(conf) == POF_INVALID) { in pool_conf_export()
1628 return (conf->pc_prov->pc_export(conf, location, fmt)); in pool_conf_export()
1636 pool_conf_validate(const pool_conf_t *conf, pool_valid_level_t level) in pool_conf_validate() argument
1638 if (pool_conf_status(conf) == POF_INVALID) { in pool_conf_validate()
1642 return (conf->pc_prov->pc_validate(conf, level)); in pool_conf_validate()
1650 pool_conf_update(const pool_conf_t *conf, int *changed) in pool_conf_update() argument
1652 if (pool_conf_status(conf) == POF_INVALID || in pool_conf_update()
1653 conf_is_dynamic(conf) == PO_FALSE) { in pool_conf_update()
1665 return (pool_knl_update((pool_conf_t *)conf, changed)); in pool_conf_update()
1674 pool_walk_properties(pool_conf_t *conf, pool_elem_t *elem, void *arg, in pool_walk_properties() argument
1678 return (pool_walk_any_properties(conf, elem, arg, prop_callback, 0)); in pool_walk_properties()
1700 pool_walk_any_properties(pool_conf_t *conf, pool_elem_t *elem, void *arg, in pool_walk_any_properties() argument
1709 if (pool_conf_status(conf) == POF_INVALID) { in pool_walk_any_properties()
1747 if (prop_callback(conf, elem, props[i].pp_pname, in pool_walk_any_properties()
1781 if (prop_callback(conf, elem, props[i].pp_pname, in pool_walk_any_properties()
1798 if (prop_callback(conf, elem, name, pvals[i], in pool_walk_any_properties()
1818 pool_get_pool(const pool_conf_t *conf, const char *name) in pool_get_pool() argument
1828 if (pool_conf_status(conf) == POF_INVALID) { in pool_get_pool()
1837 rs = pool_query_pools(conf, &size, props); in pool_get_pool()
1858 pool_query_pools(const pool_conf_t *conf, uint_t *size, pool_value_t **props) in pool_query_pools() argument
1865 if (pool_conf_status(conf) == POF_INVALID) { in pool_query_pools()
1869 rs = pool_exec_query(conf, NULL, NULL, PEC_QRY_POOL, props); in pool_query_pools()
1901 pool_get_resource(const pool_conf_t *conf, const char *sz_type, in pool_get_resource() argument
1912 if (pool_conf_status(conf) == POF_INVALID) { in pool_get_resource()
1945 rs = pool_query_resources(conf, &size, props); in pool_get_resource()
1966 pool_query_resources(const pool_conf_t *conf, uint_t *size, in pool_query_resources() argument
1974 if (pool_conf_status(conf) == POF_INVALID) { in pool_query_resources()
1981 rs = pool_exec_query(conf, NULL, NULL, PEC_QRY_RES, props); in pool_query_resources()
2017 pool_query_components(const pool_conf_t *conf, uint_t *size, in pool_query_components() argument
2020 return (pool_query_resource_components(conf, NULL, size, props)); in pool_query_components()
2029 pool_destroy(pool_conf_t *conf, pool_t *pp) in pool_destroy() argument
2033 if (pool_conf_check(conf) != PO_SUCCESS) in pool_destroy()
2056 pool_resource_destroy(pool_conf_t *conf, pool_resource_t *prs) in pool_resource_destroy() argument
2065 if (pool_conf_check(conf) != PO_SUCCESS) in pool_resource_destroy()
2078 if ((pl = pool_query_pools(conf, &npool, NULL)) != NULL) { in pool_resource_destroy()
2084 if ((rl = pool_query_pool_resources(conf, pl[i], &nres, in pool_resource_destroy()
2088 if (pool_dissociate(conf, pl[i], in pool_resource_destroy()
2110 if ((rl = pool_query_resource_components(conf, prs, &res_size, in pool_resource_destroy()
2112 int ostate = conf->pc_state; in pool_resource_destroy()
2113 conf->pc_state = POF_DESTROY; in pool_resource_destroy()
2114 if (pool_resource_xtransfer(conf, prs, default_set_res, in pool_resource_destroy()
2117 conf->pc_state = ostate; in pool_resource_destroy()
2120 conf->pc_state = ostate; in pool_resource_destroy()
2162 pool_exec_query(const pool_conf_t *conf, const pool_elem_t *src, in pool_exec_query() argument
2165 return (conf->pc_prov->pc_exec_query(conf, src, src_attr, classes, in pool_exec_query()
2253 pool_conf_t *conf = TO_CONF(TO_ELEM(src)); in choose_components() local
2260 if ((components = pool_query_resource_components(conf, src, &ncomponent, in choose_components()
2274 if (pool_resource_xtransfer(conf, src, dst, moved) == in choose_components()
2288 if (pool_resource_xtransfer(conf, src, dst, moved) == in choose_components()
2311 setup_transfer(pool_conf_t *conf, pool_resource_t *src, pool_resource_t *tgt, in setup_transfer() argument
2317 if (pool_conf_check(conf) != PO_SUCCESS) in setup_transfer()
2348 if (pool_conf_status(conf) != POF_DESTROY) { in setup_transfer()
2354 dprintf("conf is %s\n", pool_conf_location(conf)); in setup_transfer()
2374 pool_resource_transfer(pool_conf_t *conf, pool_resource_t *src, in pool_resource_transfer() argument
2381 if ((ret = setup_transfer(conf, src, tgt, size, &src_size, &tgt_size)) in pool_resource_transfer()
2392 ret = conf->pc_prov->pc_res_xfer(src, tgt, size); in pool_resource_transfer()
2416 pool_resource_xtransfer(pool_conf_t *conf, pool_resource_t *src, in pool_resource_xtransfer() argument
2434 dprintf("in conf %s\n", pool_conf_location(conf)); in pool_resource_xtransfer()
2443 if (pool_get_owning_resource(conf, rl[i]) != src) { in pool_resource_xtransfer()
2451 if ((ret = setup_transfer(conf, src, tgt, size, &src_size, &tgt_size)) in pool_resource_xtransfer()
2455 ret = conf->pc_prov->pc_res_xxfer(src, tgt, rl); in pool_resource_xtransfer()
2484 pool_get_owning_resource(const pool_conf_t *conf, const pool_component_t *comp) in pool_get_owning_resource() argument
2486 if (pool_conf_status(conf) == POF_INVALID) { in pool_get_owning_resource()
2524 pool_conf_to_elem(const pool_conf_t *conf) in pool_conf_to_elem() argument
2528 if (pool_conf_status(conf) == POF_INVALID) { in pool_conf_to_elem()
2532 if ((sys = pool_conf_system(conf)) == NULL) { in pool_conf_to_elem()
2540 pool_to_elem(const pool_conf_t *conf, const pool_t *pp) in pool_to_elem() argument
2542 if (pool_conf_status(conf) == POF_INVALID) { in pool_to_elem()
2550 pool_resource_to_elem(const pool_conf_t *conf, const pool_resource_t *prs) in pool_resource_to_elem() argument
2552 if (pool_conf_status(conf) == POF_INVALID) { in pool_resource_to_elem()
2560 pool_component_to_elem(const pool_conf_t *conf, const pool_component_t *pr) in pool_component_to_elem() argument
2562 if (pool_conf_status(conf) == POF_INVALID) { in pool_component_to_elem()
2574 pool_walk_pools(pool_conf_t *conf, void *arg, in pool_walk_pools() argument
2575 int (*callback)(pool_conf_t *conf, pool_t *pool, void *arg)) in pool_walk_pools() argument
2582 if (pool_conf_status(conf) == POF_INVALID) { in pool_walk_pools()
2587 if ((rs = pool_query_pools(conf, &size, NULL)) == NULL) /* None */ in pool_walk_pools()
2590 if (callback(conf, rs[i], arg) != PO_SUCCESS) { in pool_walk_pools()
2603 pool_walk_components(pool_conf_t *conf, pool_resource_t *prs, void *arg, in pool_walk_components() argument
2604 int (*callback)(pool_conf_t *conf, pool_component_t *pr, void *arg)) in pool_walk_components() argument
2611 if (pool_conf_status(conf) == POF_INVALID) { in pool_walk_components()
2616 if ((rs = pool_query_resource_components(conf, prs, &size, NULL)) == in pool_walk_components()
2620 if (callback(conf, rs[i], arg) != PO_SUCCESS) { in pool_walk_components()
2632 pool_query_pool_resources(const pool_conf_t *conf, const pool_t *pp, in pool_query_pool_resources() argument
2640 if (pool_conf_status(conf) == POF_INVALID) { in pool_query_pool_resources()
2647 rs = pool_exec_query(conf, pe, "res", PEC_QRY_RES, props); in pool_query_pool_resources()
2681 pool_walk_resources(pool_conf_t *conf, pool_t *pp, void *arg, in pool_walk_resources() argument
2689 if (pool_conf_status(conf) == POF_INVALID) { in pool_walk_resources()
2693 if ((rs = pool_query_pool_resources(conf, pp, &size, NULL)) == NULL) in pool_walk_resources()
2696 if (callback(conf, rs[i], arg) != PO_SUCCESS) { in pool_walk_resources()
2708 pool_query_resource_components(const pool_conf_t *conf, in pool_query_resource_components() argument
2716 if (pool_conf_status(conf) == POF_INVALID) { in pool_query_resource_components()
2722 rs = pool_exec_query(conf, pe, NULL, PEC_QRY_COMP, props); in pool_query_resource_components()
2777 pool_associate(pool_conf_t *conf, pool_t *pool, const pool_resource_t *res) in pool_associate() argument
2779 if (pool_conf_check(conf) != PO_SUCCESS) in pool_associate()
2791 pool_dissociate(pool_conf_t *conf, pool_t *pool, const pool_resource_t *res) in pool_dissociate() argument
2793 if (pool_conf_check(conf) != PO_SUCCESS) in pool_dissociate()
2932 pool_conf_check(const pool_conf_t *conf) in pool_conf_check() argument
2934 if (pool_conf_status(conf) == POF_INVALID) { in pool_conf_check()
2939 if ((conf->pc_prov->pc_oflags & PO_RDWR) == 0) { in pool_conf_check()