libnvme_set_test_base_dir-libnvme3(2)

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.

From nvme-cli 3.2-1 in Arch Linux 2026-11-01. Parsed by carta from the page's man source.