Add topo module and hdl api for freeing string array
There are a number of one-off implementations of routines for free'ing a string array scattered across libtopo - all of which are basically identical. This is a sign that this should be promoted to a module API. So this CR is to add such an interface and replace all the one-offs with it.
This would add two new interfaces:
topo_mod_strfreev(topo_mod_t *mod, char **strarr, uint_t nelem)
topo_hdl_strfreev(topo_hdl_t *thp, char **strarr, uint_t nelem)
Note. This change has already been made downstream in illumos-joyent via the following commit:
commit b4f12da28f2cbdf1900e7fa9d5cd12c565501fc8 Author: Rob Johnston <email@example.com> Date: Sat Jun 1 01:57:43 2019 +0000 OS-6707 Add topo module and hdl api for freeing string array Reviewed by: Jordan Hendricks <firstname.lastname@example.org> Approved by: Joshua M. Clulow <email@example.com>
So this ticket is simply to track porting the above commit upstream.
Updated by Rob Johnston over 2 years ago
Did a full debug build and made sure there were no compiler warnings. Also verified that the changes were pbchk and smatch-clean.
Built a PI with this change and then booted it on a handful of systems in the Joyent lab and then manually inspected the output of "fmtopo -V" to verify that topo snapshots were still being created correctly. Generating a topo snapshot exercises all of the changed code with the exception of the change to platform-mem/mem.c, which is sparc only.
To sanity check the upstream port, I installed an openindiana system with this fix using onu and compared the topo snapshot with and without the fix and verified there were no differences.
Updated by Electric Monk over 2 years ago
- Status changed from New to Closed
- % Done changed from 0 to 100
commit e2336878c3b2087bcf5c52436847f37afaec8666 Author: Rob Johnston <firstname.lastname@example.org> Date: 2019-11-23T22:03:25.000Z 11960 Add topo module and hdl api for freeing string array Reviewed by: Jordan Hendricks <email@example.com> Reviewed by: Matthias Scheler <firstname.lastname@example.org> Approved by: Robert Mustacchi <email@example.com>