linux-nvme.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
* libnvme v2
@ 2025-07-09 13:24 Daniel Wagner
  2025-07-09 13:27 ` Daniel Wagner
  0 siblings, 1 reply; 2+ messages in thread
From: Daniel Wagner @ 2025-07-09 13:24 UTC (permalink / raw)
  To: linux-nvme@lists.infradead.org

I've started working on v2 of the library. There are several reasons why
I think it's time for a major update.

libnvme added the MI APIs after the initial v1 release. The v1 APIs use
file descriptors as "handles," which do not work for MI (there are no
fds). So, the solution at the time was to duplicate a lot of APIs with a
different kind of "handle." The main issue here is the naming for the
new handle. I went with struct nvme_link, but I'm sure there are better
names. While I'm not keen on renaming (a hell of a lot of hacking), it's
better to have good name [1]. So let's start the bike-shedding.

Another API-breaking change is the introduction of struct nvme_root as
the top-level data structure everywhere. This allows us to store global
data—for example, logging, or the controller list for MI.

Next on the TODO list is changing the error handling. That is, drop the
POSIX-style error handling (return -1 and set errno) and just return the
error code directly.

Anyway, there's a first usable version:

https://github.com/nvme-experiments/libnvme/tree/libnvme2
https://github.com/nvme-experiments/nvme-cli/tree/nvme-cli3

Thanks,
Daniel


[1] https://github.com/linux-nvme/libnvme/issues/448#issuecomment-2915439618


^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: libnvme v2
  2025-07-09 13:24 libnvme v2 Daniel Wagner
@ 2025-07-09 13:27 ` Daniel Wagner
  0 siblings, 0 replies; 2+ messages in thread
From: Daniel Wagner @ 2025-07-09 13:27 UTC (permalink / raw)
  To: linux-nvme@lists.infradead.org

On Wed, Jul 09, 2025 at 03:24:01PM +0200, Daniel Wagner wrote:
> I've started working on v2 of the library. There are several reasons why
> I think it's time for a major update.
> 
> libnvme added the MI APIs after the initial v1 release. The v1 APIs use
> file descriptors as "handles," which do not work for MI (there are no
> fds). So, the solution at the time was to duplicate a lot of APIs with a
> different kind of "handle." The main issue here is the naming for the
> new handle. I went with struct nvme_link, but I'm sure there are better
> names. While I'm not keen on renaming (a hell of a lot of hacking), it's
> better to have good name [1]. So let's start the bike-shedding.

Forgot to mention, the diff stat is nice:

 40 files changed, 1903 insertions(+), 4734 deletions(-)


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2025-07-09 15:54 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-07-09 13:24 libnvme v2 Daniel Wagner
2025-07-09 13:27 ` Daniel Wagner

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).