]> www.infradead.org Git - users/sagi/nvme-cli.git/commit
libnvme-wrap: exit on VOID_FN lookup failure
authorCaleb Sander <csander@purestorage.com>
Sun, 5 Nov 2023 16:02:02 +0000 (09:02 -0700)
committerDaniel Wagner <wagi@monom.org>
Tue, 7 Nov 2023 08:08:09 +0000 (09:08 +0100)
commitd83183918a44f7175aa709962db83670fadf871b
treee46fd2185a8a935a300938d69d5a0df96005364c
parent70b4959da637797f3cc6b51647d61499a7c4e5f6
libnvme-wrap: exit on VOID_FN lookup failure

libnvme-wrap provides fallbacks for missing libnvme functions.
For functions that return a value, the FN() macro can be used
to define a default return value if the function isn't found.
This isn't possible for functions returning void,
so VOID_FN() currently is a no-op if the function can't be found.
For nvme_init_copy_range_f1(), the only current VOID_FN() user,
this will result in silently sending a Copy command
with a zeroed range, which is not what the user requested.
Instead, exit the process immediately if the function can't be found.

Signed-off-by: Caleb Sander <csander@purestorage.com>
libnvme-wrap.c