Testing Done: |
|
---|
libtopo: add API for doing deep copy of a topo_list
Review Request #2470 — Created Dec. 10, 2019 and submitted
Information | |
---|---|
rejohnst | |
illumos-gate | |
12059 | |
Reviewers | |
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
-
-
usr/src/lib/fm/topo/libtopo/common/topo_list.c (Diff revision 1) 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 getconst
. Though looking at the topo_list_prev/next I'm not sure that'll work. -
usr/src/lib/fm/topo/libtopo/common/topo_list.c (Diff revision 1) Do we need to make sure an appropriate error is set on the topo_hdl as topo_hdl_free might clobber one.
Change Summary:
Updates to topo_list_deepcopy() based on feedback from danmcd
Diff: |
Revision 3 (+49 -5) |
---|