by lundman » Fri Jan 05, 2018 12:24 am
Yes and no.
First, on the spawning of the commands, many options have "-H" for header less and some other option for machine parsable, so that is at least nice. There was ZOL work for JSON output as well.
Internally, libzfs is a pain to work with, so they started libzfs_core, which is what will be the API for calling processes. It is not done, but has a start. I think that Ryao over in ZOL land did some additional work on it, but I never saw a PR, so who knows what happened there.
Personally, I would do new code by just calling libzfs_core and libzfs, and just deal with that the library functions may just not work each time you update ZFS, and tweak the calling code. But if you want something that requires much less maintenance, spawning is probably the most stable.
Lund