On Wed, Jun 19, 2024 at 06:34:24PM +0100, David Chisnall wrote: > Hi all, > > I have some code using libzfs_core that works fine on 13, but seems not to on > 15-CURRENT. The lzc_snapshot function is failing with exactly the same nv > list argument. It is failing with errno 2 (ENOENT) from the ZFS ioctl (and > not returning an nvlist of errors). > > My understanding is that the zfs command-line tool wraps libzfs_core and so > it must be working somehow. Has anything changed in between 13 and 14 that > would be expected to cause incompatibilities? The fact that we don’t install > usable headers for these libraries makes it quite difficult to be sure that I > haven’t done anything wrong, but stepping through the libzfs_core bits in a > debugger, everything looks correct up to the ioctl call.
I have a little wrapper around libzfs{,_core}: https://git.hardenedbsd.org/shawn.webb/liblattzfs It kinda sucks, but fills a need. We imported that into HardenedBSD base. We don't link against libzfs_core, but we do reference a header: https://git.hardenedbsd.org/shawn.webb/liblattzfs/-/blob/main/src/liblattzfs.c?ref_type=heads#L40 liblattzfs mainly serves to get the status of a pool. We use it in another utility, hbsdmon: https://git.hardenedbsd.org/hardenedbsd/hbsdmon hbsdmon is a simple HardenedBSD system monitoring tool. It can monitor a ZFS pool, sending a Pushover message if the pool is unhealthy: https://git.hardenedbsd.org/hardenedbsd/hbsdmon/-/blob/master/usr.bin/hbsdmon/zfs.c?ref_type=heads So to answer your question of whether there are any libzfs_core consumers: yes, but only the C headers. My use case seems quite different than yours, so the information presented in this email might not be applicable. Thanks, -- Shawn Webb Cofounder / Security Engineer HardenedBSD Tor-ified Signal: +1 303-901-1600 / shawn_webb_opsec.50 https://git.hardenedbsd.org/hardenedbsd/pubkeys/-/raw/master/Shawn_Webb/03A4CBEBB82EA5A67D9F3853FF2E67A277F8E1FA.pub.asc
signature.asc
Description: PGP signature