Skip to content
Snippets Groups Projects
Commit 27fa44ef authored by Utz-Uwe Haus's avatar Utz-Uwe Haus
Browse files

implement mstro_drc_init_from_credential()

parent 33b3178f
No related branches found
No related tags found
1 merge request!45Draft: Resolve "Check if shm provider can be enabled after libfabric 1.14 is in our tree"
......@@ -347,7 +347,39 @@ mstro_status
mstro_drc_init_from_credential(mstro_drc_info *result_p,
uint32_t credential)
{
return MSTRO_UNIMPL;
mstro_status stat = MSTRO_UNIMPL;
uint32_t id = credential;
int ret;
if(result_p==NULL)
return MSTRO_INVOUT;
*result_p = malloc(sizeof(struct mstro_drc_info_));
if(*result_p) {
drc_info_handle_t info;
(*result_p)->drc_id = id;
ret = drc_access((*result_p)->drc_id, 0, &info);
if(ret!=DRC_SUCCESS) {
ERR("Failed to drc_access credential %" PRIu32 ": %d\n", id, ret);
goto BAILOUT_FREE;
}
mstro_drc_init_internal(*result_p, info);
DEBUG("Accessing DRC credential %d (OOB: is %s), cookie %" PRIx64 ")\n",
(*result_p)->drc_id,
(*result_p)->serialized_id,
(*result_p)->auth_key.raw.protection_key);
stat = MSTRO_OK;
} else {
stat = MSTRO_NOMEM;
}
goto BAILOUT;
BAILOUT_FREE:
NFREE(*result_p);
BAILOUT:
return stat;
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment