Project

General

Profile

Actions

Feature #11960

closed

Add topo module and hdl api for freeing string array

Added by Rob Johnston over 3 years ago. Updated over 3 years ago.

Status:
Closed
Priority:
Normal
Assignee:
Category:
-
Start date:
Due date:
% Done:

100%

Estimated time:
Difficulty:
Bite-size
Tags:
Gerrit CR:
External Bug:

Description

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)

and
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 <rob.johnston@joyent.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 <jordan.hendricks@joyent.com>
    Approved by: Joshua M. Clulow <josh@sysmgr.org>

So this ticket is simply to track porting the above commit upstream.

Actions #1

Updated by Rob Johnston over 3 years ago

Testing

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.

Actions #2

Updated by Electric Monk over 3 years ago

  • Status changed from New to Closed
  • % Done changed from 0 to 100

git commit e2336878c3b2087bcf5c52436847f37afaec8666

commit  e2336878c3b2087bcf5c52436847f37afaec8666
Author: Rob Johnston <rob.johnston@joyent.com>
Date:   2019-11-23T22:03:25.000Z

    11960 Add topo module and hdl api for freeing string array
    Reviewed by: Jordan Hendricks <jordan.hendricks@joyent.com>
    Reviewed by: Matthias Scheler <matthias.scheler@wdc.com>
    Approved by: Robert Mustacchi <rm@fingolfin.org>

Actions

Also available in: Atom PDF