Backend Interface#
The core of the xNVMe API is encapsulated by a backend interface. The backend interface consists of implementations of the following.
Attributes#
name, name of the backendschemes, array of supported prefixes e.g.filenschemes, number of schemesenabled, property indicating whether the backend-support is compiled in
Device#
enumerate(), lists devicesdev_from_ident(), open of a given device and return a handledev_close(), close a device handle
Memory#
buf_alloc(), allocate buffer usable with commandsbuf_free(), de-allocate buffersbuf_vtophys()buf_realloc()
Asynchronous#
cmd_io(), submit an IO-command to a qpairpoke(), process completions on a qpairwait(), wait until all outstanding commands are completedinit(), initialize a qpairterm(), terminate a qpairsupported(), informed whether async. commands are supported
Synchronous#
cmd_io(), submit an IO-command and wait for its completioncmd_admin(), submit and Admin-command and wait for its completionsupported(), inform wether sync. commands are supported
Backend Interface - Implementation#
If you want to add a backend for e.g. Windows 10, you could add the
implementation in src/xnvme_be_win10.c and then it to the backend registry
in include/xnvme_be_registry.h and src/xnvme_be.c.
Have a look at the existing backend-implementations:
xnvme_be.cxnvme_be_*.cinclude/xnvme_be_registry.h
And the definition of the backend-interface in:
include/xnvme_be.h