libnvme_set_test_base_dir-libnvme32
Reroot libnvme's on-disk files for testing
Usage
int libnvme_set_test_base_dir (struct libnvme_global_ctx *ctx , const char *path );
Arguments
ctx
|
struct libnvme_global_ctx object |
|---|---|
path
|
Sandbox directory under /tmp, or NULL to restore defaults |
Overview
Redirects the files libnvme reads and writes (the exclusion list, the ownership registry, ...) under path instead of their production locations, so a test can run against a throwaway directory. For safety path must be confined to /tmp and contain no ".." component; anything else is rejected. Passing NULL clears a previously set override.
Return
0 on success, -EINVAL if ctx is NULL or path is not a valid sandbox path, -ENOMEM on allocation failure.