[dm-devel] [PATCH 00/11] multipath-tools: improvements for pretty-printing code

mwilck at suse.com mwilck at suse.com
Sat Nov 27 15:19:55 UTC 2021


From: Martin Wilck <mwilck at suse.com>

Hi Christophe, hi Ben,

this series attempts to improve the robustness of the code by making the lookup
tables used for pretty printing and wildcard hanling static const arrays.
This requires getting rid of the variable "width" field in these arrays.
I could have simply split of "width" into a separate global array variable,
but as the field width are designed to change depending on the data being
printed, it makes more sense to use local variables for it and pass them to
the actual table-formatting code.

A couple of minor cleanups are done along the way.

As always, feedback welcome
Martin

Martin Wilck (11):
  libmultipath: make multipath_data etc. static
  libmultipath: move path_data etc. to print.c
  libmultipath: make pd_lookup() etc. return an index
  libmultipath: use ARRAY_SIZE for iterating over wildcard arrays
  libmultipath: drop padding code in _snprint_pathgroup()
  libmultipath: snprint_foreign_topology(): split out lockless variant
  multipathd: drop unnecessary path layout calls
  libmultipath: add a cleanup function for unsigned char *
  libmultipath: make sprint_path_marginal() static
  libmultipath: introduce width argument for pretty-printing functions
  libmultipath: change wildcard handler tables to static const

 libmultipath/foreign.c            |  72 ++++--
 libmultipath/foreign.h            |  25 ++-
 libmultipath/libmultipath.version |   5 +-
 libmultipath/print.c              | 360 +++++++++++++++++-------------
 libmultipath/print.h              |  60 ++---
 libmultipath/util.c               |   5 +
 libmultipath/util.h               |   1 +
 multipath/main.c                  |   7 +-
 multipathd/cli_handlers.c         |  79 ++++---
 9 files changed, 360 insertions(+), 254 deletions(-)

-- 
2.33.1





More information about the dm-devel mailing list