libmultipath: "generic multipath" interface
authorMartin Wilck <mwilck@suse.com>
Mon, 5 Mar 2018 23:14:56 +0000 (00:14 +0100)
committerChristophe Varoqui <christophe.varoqui@opensvc.com>
Wed, 7 Mar 2018 09:39:49 +0000 (10:39 +0100)
commit26a3ad26031a6909f9f0c281fd9c2dd694d78f34
treec65cc82eb7c57b466f2302b048ded05d2839391e
parentb82790627386c3e4a71b1661a3b79faa23be0108
libmultipath: "generic multipath" interface

This patch adds a simplified abstract interface to the multipath data structures.
The idea is to allow "foreign" data structures to be treated by libmultipath
if they implement the same interface. Currently, the intention is to use this
only to provide formatted output about from this interface.

This interface assumes only that the data structure is organized in maps
containing path groups containing paths, and that formatted printing (using
the wildcards defined in libmultipath) is possible on each level of the data
structure.

The patch also implements the interface for the internal dm_multipath data
structure.

The style() method looks a bit exotic, but it's necessary because
print_multipath_topology() uses different formats depending on the mpp
properties. This needs to be in the generic interface, too, if we want to
produce identical output.

Signed-off-by: Martin Wilck <mwilck@suse.com>
libmultipath/Makefile
libmultipath/dm-generic.c [new file with mode: 0644]
libmultipath/dm-generic.h [new file with mode: 0644]
libmultipath/generic.c [new file with mode: 0644]
libmultipath/generic.h [new file with mode: 0644]
libmultipath/list.h
libmultipath/print.c
libmultipath/print.h
libmultipath/structs.c
libmultipath/structs.h