libtopo: add API for doing deep copy of a topo_list

Review Request #2470 — Created Dec. 10, 2019 and submitted

rejohnst
illumos-gate
12059
general

Libtopo provides a set of typedefs and interfaces for managing and iterating over doubly-linked lists (topo_list). This ticket to cover the work to add a new interface for making a deep copy of a topo_list.

This new interface is currently being leveraged by the tooling that is SAS topology project in illumos-joyent. That tooling exercises the new topo_list_deepcopy() interface. For example:

https://github.com/joyent/illumos-joyent/blob/sastopo/usr/src/lib/fm/topo/libtopo/common/topo_digraph.c#L359

We're upstreaming this change as one of the prerequisites for upstreaming the larger pieces of the SAS Topology project.

See the ticket for additional testing notes:

https://www.illumos.org/issues/12059

  • 0
  • 0
  • 1
  • 0
  • 1
Description From Last Updated
rejohnst
rm
  1. 
      
  2. I'm not sure if the topo_list_t APIs would let us, but if we can, it might be nice to make the source list const and the data that we get const. Though looking at the topo_list_prev/next I'm not sure that'll work.

  3. Do we need to make sure an appropriate error is set on the topo_hdl as topo_hdl_free might clobber one.
  4. 
      
rejohnst
rm
  1. Ship It!
  2. 
      
rejohnst
rejohnst
Review request changed

Status: Closed (submitted)

Loading...