Hi, I have noticed that the signature of zpool_iter has changed in the latest NV builds in comparison to Solaris 10 update 2. Unfortunately libzfs.h did not state that this is a private interface, so I assumed that it would be stable across various releases. My sysstat tool uses libzfs.so dynamically, i.e. it calls dlopen to use it instead of letting the runtime linker do the work. Like this it is possible to compile sysstat once on Solaris 8 and use the same executable on releases 8 to 10 and provide zfs information when libzfs is available. Unfortunately this method breaks with the change of the signature, because zpool_iter requires an additional parameter now. How would it be possible for me to determine at runtime which version of libzfs is on the system and therefore be able to use the correct calling method? Any hints would be highly appreciated. TIA, Tom -- This messages posted from opensolaris.org
Tom, Solaris 10u3 will deliver both the original libzfs.so.1 and a new libzfs.so.2, which will include the new interface to zpool_iter. One way to determine which version of the library you are using is to look for libzfs_init(). This function only appears in the new library. Also worth noting that once we deliver this change in s10u3 there will only be one libzfs.h so if you continue to use the old library you will need to maintain a private copy of the old libzfs.h. Hope this helps, George Thomas Maier-Komor wrote:> Hi, > > I have noticed that the signature of zpool_iter has changed in the latest NV builds in comparison to Solaris 10 update 2. Unfortunately libzfs.h did not state that this is a private interface, so I assumed that it would be stable across various releases. > > My sysstat tool uses libzfs.so dynamically, i.e. it calls dlopen to use it instead of letting the runtime linker do the work. Like this it is possible to compile sysstat once on Solaris 8 and use the same executable on releases 8 to 10 and provide zfs information when libzfs is available. > > Unfortunately this method breaks with the change of the signature, because zpool_iter requires an additional parameter now. > > How would it be possible for me to determine at runtime which version of libzfs is on the system and therefore be able to use the correct calling method? > > Any hints would be highly appreciated. > > TIA, > Tom > -- > This messages posted from opensolaris.org > _______________________________________________ > zfs-code mailing list > zfs-code at opensolaris.org > http://opensolaris.org/mailman/listinfo/zfs-code
On Mon, Aug 07, 2006 at 04:53:27AM -0700, Thomas Maier-Komor wrote:> > I have noticed that the signature of zpool_iter has changed in the > latest NV builds in comparison to Solaris 10 update 2. Unfortunately > libzfs.h did not state that this is a private interface, so I assumed > that it would be stable across various releases. >For future reference, if there is no manpage for a function or library, then it should be assumed to be private (or use elfdump -sv to see the symbol is SUNWprivate_1.1). In the past, we used to play tricks to ''hide'' private interfaces, such as not shipping header files, shipping files in alternate locations, and not delivering .so links. This was found to be painful and unnecessary for those users who understood that the interfaces might change, but wanted to use them anyway. The more common practice today is to inform stability through documentation. But without any documentation or indication otherwise, please do not assume that any interface is public. We currently have no plans to make the libzfs interface stable. If we do undertake this task, it would likely be after the majority of the planned features have been implemented. - Eric -- Eric Schrock, Solaris Kernel Development http://blogs.sun.com/eschrock