multipath-tools: extended github CI
Subsystems (2)
cover multipath-tools: extended github CI
From: Martin Wilck <[email protected]>
Hi Christophe, hi Ben,
I've spent most of this week trying to improve the multipath-tools CI workflows on github. I now have CI workflows for 7 different distributions covering ~6 years of development, and 5 different architectures, running routinely on Github. While I found only one minor bug in multipath-tools in this process, I hope this will help avoiding regressions on less frequently-tested distributions in the future. Please read the commit message of the patch "github workflows:
add containerized / multi-arch tests" for the details.
You can see this in action on https://github.com/openSUSE/multipath-tools/actions.
The patch set is included in the "tip" branch.
What we need now is more unit tests; our code coverage is still pretty pathetic.
LOC-wise, the bulk of this patch set are libdmmp man pages. These are almost 100% static. Including them in git allows us to get rid of perl as a build-time requirement, which will allow me (in the future) to reduce the size of the build container images significantly.
Regards
Martin
Martin Wilck (7):
multipath-tools Makefiles: make pkg-config configurable multipath-tools Makefiles: allow building test programs only github workflows: add containerized / multi-arch tests
libdmmp: allow building without perl
multipath-tools Makefile: build before install
fixup "multipath-tools tests: check if /sys/dev/block is non-empty"
libmultipath: fix warning with clang 3.5
.github/workflows/build-and-unittest.yaml | 4 +-
.github/workflows/foreign.yaml | 65 +++++++++++++++++++
.github/workflows/native.yaml | 31 +++++++++
Makefile | 9 ++-
Makefile.inc | 6 +-
libdmmp/Makefile | 41 +++++-------
libdmmp/docs/man/dmmp_context_free.3 | 15 +++++
libdmmp/docs/man/dmmp_context_log_func_set.3 | 21 ++++++
.../docs/man/dmmp_context_log_priority_get.3 | 23 +++++++
.../docs/man/dmmp_context_log_priority_set.3 | 29 +++++++++
libdmmp/docs/man/dmmp_context_new.3 | 19 ++++++
libdmmp/docs/man/dmmp_context_timeout_get.3 | 15 +++++
libdmmp/docs/man/dmmp_context_timeout_set.3 | 19 ++++++
libdmmp/docs/man/dmmp_context_userdata_get.3 | 15 +++++
libdmmp/docs/man/dmmp_context_userdata_set.3 | 18 +++++
libdmmp/docs/man/dmmp_flush_mpath.3 | 36 ++++++++++
libdmmp/docs/man/dmmp_last_error_msg.3 | 16 +++++
libdmmp/docs/man/dmmp_log_priority_str.3 | 24 +++++++
libdmmp/docs/man/dmmp_mpath_array_free.3 | 18 +++++
libdmmp/docs/man/dmmp_mpath_array_get.3 | 36 ++++++++++
libdmmp/docs/man/dmmp_mpath_kdev_name_get.3 | 17 +++++
libdmmp/docs/man/dmmp_mpath_name_get.3 | 18 +++++
libdmmp/docs/man/dmmp_mpath_wwid_get.3 | 13 ++++
libdmmp/docs/man/dmmp_path_array_get.3 | 25 +++++++
libdmmp/docs/man/dmmp_path_blk_name_get.3 | 17 +++++
libdmmp/docs/man/dmmp_path_group_array_get.3 | 27 ++++++++
libdmmp/docs/man/dmmp_path_group_id_get.3 | 18 +++++
.../docs/man/dmmp_path_group_priority_get.3 | 16 +++++
.../docs/man/dmmp_path_group_selector_get.3 | 16 +++++
libdmmp/docs/man/dmmp_path_group_status_get.3 | 23 +++++++
libdmmp/docs/man/dmmp_path_group_status_str.3 | 26 ++++++++
libdmmp/docs/man/dmmp_path_status_get.3 | 54 +++++++++++++++
libdmmp/docs/man/dmmp_path_status_str.3 | 34 ++++++++++
libdmmp/docs/man/dmmp_reconfig.3 | 27 ++++++++
libdmmp/docs/man/dmmp_strerror.3 | 33 ++++++++++
libdmmp/docs/{ => man}/libdmmp.h.3 | 0
libmultipath/io_err_stat.c | 2 +-
tests/Makefile | 1 +
tests/devt.c | 2 +-
39 files changed, 797 insertions(+), 32 deletions(-)
create mode 100644 .github/workflows/foreign.yaml
create mode 100644 .github/workflows/native.yaml
create mode 100644 libdmmp/docs/man/dmmp_context_free.3
create mode 100644 libdmmp/docs/man/dmmp_context_log_func_set.3
create mode 100644 libdmmp/docs/man/dmmp_context_log_priority_get.3
create mode 100644 libdmmp/docs/man/dmmp_context_log_priority_set.3
create mode 100644 libdmmp/docs/man/dmmp_context_new.3
create mode 100644 libdmmp/docs/man/dmmp_context_timeout_get.3
create mode 100644 libdmmp/docs/man/dmmp_context_timeout_set.3
create mode 100644 libdmmp/docs/man/dmmp_context_userdata_get.3
create mode 100644 libdmmp/docs/man/dmmp_context_userdata_set.3
create mode 100644 libdmmp/docs/man/dmmp_flush_mpath.3
create mode 100644 libdmmp/docs/man/dmmp_last_error_msg.3
create mode 100644 libdmmp/docs/man/dmmp_log_priority_str.3
create mode 100644 libdmmp/docs/man/dmmp_mpath_array_free.3
create mode 100644 libdmmp/docs/man/dmmp_mpath_array_get.3
create mode 100644 libdmmp/docs/man/dmmp_mpath_kdev_name_get.3
create mode 100644 libdmmp/docs/man/dmmp_mpath_name_get.3
create mode 100644 libdmmp/docs/man/dmmp_mpath_wwid_get.3
create mode 100644 libdmmp/docs/man/dmmp_path_array_get.3
create mode 100644 libdmmp/docs/man/dmmp_path_blk_name_get.3
create mode 100644 libdmmp/docs/man/dmmp_path_group_array_get.3
create mode 100644 libdmmp/docs/man/dmmp_path_group_id_get.3
create mode 100644 libdmmp/docs/man/dmmp_path_group_priority_get.3
create mode 100644 libdmmp/docs/man/dmmp_path_group_selector_get.3
create mode 100644 libdmmp/docs/man/dmmp_path_group_status_get.3
create mode 100644 libdmmp/docs/man/dmmp_path_group_status_str.3
create mode 100644 libdmmp/docs/man/dmmp_path_status_get.3
create mode 100644 libdmmp/docs/man/dmmp_path_status_str.3
create mode 100644 libdmmp/docs/man/dmmp_reconfig.3
create mode 100644 libdmmp/docs/man/dmmp_strerror.3
rename libdmmp/docs/{ => man}/libdmmp.h.3 (100%)Signature · 7 lines
2.30.1 -- dm-devel mailing list [email protected] https://listman.redhat.com/mailman/listinfo/dm-devel
PATCH 4/7 libdmmp: allow building without perl
From: Martin Wilck <[email protected]>
Add the kernel-doc generated manpages of libdmmp to git, and change the libdmmp Makefile to regenerate them (only) when necessary.
This allows us to drop perl as a build-time requirement.
---
libdmmp/Makefile | 37 ++++++-------
libdmmp/docs/man/dmmp_context_free.3 | 15 ++++++
libdmmp/docs/man/dmmp_context_log_func_set.3 | 21 ++++++++
.../docs/man/dmmp_context_log_priority_get.3 | 23 ++++++++
.../docs/man/dmmp_context_log_priority_set.3 | 29 ++++++++++
libdmmp/docs/man/dmmp_context_new.3 | 19 +++++++
libdmmp/docs/man/dmmp_context_timeout_get.3 | 15 ++++++
libdmmp/docs/man/dmmp_context_timeout_set.3 | 19 +++++++
libdmmp/docs/man/dmmp_context_userdata_get.3 | 15 ++++++
libdmmp/docs/man/dmmp_context_userdata_set.3 | 18 +++++++
libdmmp/docs/man/dmmp_flush_mpath.3 | 36 +++++++++++++
libdmmp/docs/man/dmmp_last_error_msg.3 | 16 ++++++
libdmmp/docs/man/dmmp_log_priority_str.3 | 24 +++++++++
libdmmp/docs/man/dmmp_mpath_array_free.3 | 18 +++++++
libdmmp/docs/man/dmmp_mpath_array_get.3 | 36 +++++++++++++
libdmmp/docs/man/dmmp_mpath_kdev_name_get.3 | 17 ++++++
libdmmp/docs/man/dmmp_mpath_name_get.3 | 18 +++++++
libdmmp/docs/man/dmmp_mpath_wwid_get.3 | 13 +++++
libdmmp/docs/man/dmmp_path_array_get.3 | 25 +++++++++
libdmmp/docs/man/dmmp_path_blk_name_get.3 | 17 ++++++
libdmmp/docs/man/dmmp_path_group_array_get.3 | 27 ++++++++++
libdmmp/docs/man/dmmp_path_group_id_get.3 | 18 +++++++
.../docs/man/dmmp_path_group_priority_get.3 | 16 ++++++
.../docs/man/dmmp_path_group_selector_get.3 | 16 ++++++
libdmmp/docs/man/dmmp_path_group_status_get.3 | 23 ++++++++
libdmmp/docs/man/dmmp_path_group_status_str.3 | 26 +++++++++
libdmmp/docs/man/dmmp_path_status_get.3 | 54 +++++++++++++++++++
libdmmp/docs/man/dmmp_path_status_str.3 | 34 ++++++++++++
libdmmp/docs/man/dmmp_reconfig.3 | 27 ++++++++++
libdmmp/docs/man/dmmp_strerror.3 | 33 ++++++++++++
libdmmp/docs/{ => man}/libdmmp.h.3 | 0
31 files changed, 683 insertions(+), 22 deletions(-)
create mode 100644 libdmmp/docs/man/dmmp_context_free.3
create mode 100644 libdmmp/docs/man/dmmp_context_log_func_set.3
create mode 100644 libdmmp/docs/man/dmmp_context_log_priority_get.3
create mode 100644 libdmmp/docs/man/dmmp_context_log_priority_set.3
create mode 100644 libdmmp/docs/man/dmmp_context_new.3
create mode 100644 libdmmp/docs/man/dmmp_context_timeout_get.3
create mode 100644 libdmmp/docs/man/dmmp_context_timeout_set.3
create mode 100644 libdmmp/docs/man/dmmp_context_userdata_get.3
create mode 100644 libdmmp/docs/man/dmmp_context_userdata_set.3
create mode 100644 libdmmp/docs/man/dmmp_flush_mpath.3
create mode 100644 libdmmp/docs/man/dmmp_last_error_msg.3
create mode 100644 libdmmp/docs/man/dmmp_log_priority_str.3
create mode 100644 libdmmp/docs/man/dmmp_mpath_array_free.3
create mode 100644 libdmmp/docs/man/dmmp_mpath_array_get.3
create mode 100644 libdmmp/docs/man/dmmp_mpath_kdev_name_get.3
create mode 100644 libdmmp/docs/man/dmmp_mpath_name_get.3
create mode 100644 libdmmp/docs/man/dmmp_mpath_wwid_get.3
create mode 100644 libdmmp/docs/man/dmmp_path_array_get.3
create mode 100644 libdmmp/docs/man/dmmp_path_blk_name_get.3
create mode 100644 libdmmp/docs/man/dmmp_path_group_array_get.3
create mode 100644 libdmmp/docs/man/dmmp_path_group_id_get.3
create mode 100644 libdmmp/docs/man/dmmp_path_group_priority_get.3
create mode 100644 libdmmp/docs/man/dmmp_path_group_selector_get.3
create mode 100644 libdmmp/docs/man/dmmp_path_group_status_get.3
create mode 100644 libdmmp/docs/man/dmmp_path_group_status_str.3
create mode 100644 libdmmp/docs/man/dmmp_path_status_get.3
create mode 100644 libdmmp/docs/man/dmmp_path_status_str.3
create mode 100644 libdmmp/docs/man/dmmp_reconfig.3
create mode 100644 libdmmp/docs/man/dmmp_strerror.3
rename libdmmp/docs/{ => man}/libdmmp.h.3 (100%)libdmmp/Makefile +15 -22
@@ -21,12 +21,13 @@ CFLAGS += $(LIB_CFLAGS) -fvisibility=hidden -I$(libdmmpdir) -I$(mpathcmddir) \ LIBDEPS += $(shell $(PKGCONFIG) --libs json-c) -L$(mpathcmddir) -lmpathcmd -lpthread all: $(LIBS) doc +.PHONY: doc doc.gz clean install uninstall check speed_test dep_clean $(LIBS): $(OBJS) $(CC) $(LDFLAGS) $(SHARED_FLAGS) -Wl,-soname=$@ -o $@ $(OBJS) $(LIBDEPS) $(LN) $@ $(DEVLIB) -install: +install: doc.gz mkdir -p $(DESTDIR)$(usrlibdir) $(INSTALL_PROGRAM) -m 755 $(LIBS) $(DESTDIR)$(usrlibdir)/$(LIBS) $(INSTALL_PROGRAM) -m 644 -D \
@@ -40,11 +41,7 @@ install: $(DESTDIR)$(pkgconfdir)/$(PKGFILE) perl -i -pe 's|__INCLUDEDIR__|$(includedir)|g' \ $(DESTDIR)$(pkgconfdir)/$(PKGFILE) - @for file in docs/man/*.3.gz; do \ - $(INSTALL_PROGRAM) -m 644 -D \ - $$file \ - $(DESTDIR)$(man3dir)/ || exit $?; \ - done + $(INSTALL_PROGRAM) -m 644 -t $(DESTDIR)$(man3dir) docs/man/*.3.gz uninstall: $(RM) $(DESTDIR)$(usrlibdir)/$(LIBS)
@@ -58,7 +55,7 @@ uninstall: clean: dep_clean $(RM) core *.a *.o *.gz *.so *.so.* - $(RM) -r docs/man + $(RM) docs/man/*.gz $(MAKE) -C test clean include $(wildcard $(OBJS:.o=.d))
@@ -69,23 +66,19 @@ check: all speed_test: all $(MAKE) -C test speed_test -doc: docs/man/$(EXTRA_MAN_FILES).gz +doc.gz: doc $(patsubst %,%.gz,$(wildcard docs/man/*.3)) -TEMPFILE := $(shell mktemp) +doc: docs/man/dmmp_strerror.3 -docs/man/$(EXTRA_MAN_FILES).gz: $(HEADERS) - @for file in $(EXTRA_MAN_FILES); do \ - $(INSTALL_PROGRAM) -v -m 644 -D docs/$$file docs/man/$$file; \ - done - cat $(HEADERS) | \ - perl docs/doc-preclean.pl > "$(TEMPFILE)" - perl docs/kernel-doc -man "$(TEMPFILE)" | \ - perl docs/split-man.pl docs/man - -rm -f "$(TEMPFILE)" - @for file in docs/man/*.3; do \ - gzip -f $$file; \ - done - find docs/man -type f -name \*[0-9].gz +docs/man/%.3.gz: docs/man/%.3 + gzip -c $< >$@ + +docs/man/dmmp_strerror.3: $(HEADERS) + TEMPFILE=$(shell mktemp); \ + cat $^ | perl docs/doc-preclean.pl >$$TEMPFILE; \ + perl docs/kernel-doc -man $$TEMPFILE | \ + perl docs/split-man.pl docs/man; \ + rm -f $$TEMPFILE dep_clean: $(RM) $(OBJS:.o=.d)
libdmmp/docs/man/dmmp_context_free.3 new file +15 -0
@@ -0,0 +1,15 @@ +.TH "dmmp_context_free" 3 "dmmp_context_free" "March 2021" "Device Mapper Multipath API - libdmmp Manual" +.SH NAME +dmmp_context_free \- Release the memory of struct dmmp_context. +.SH SYNOPSIS +.B "void" dmmp_context_free +.BI "(struct dmmp_context *" ctx ");" +.SH ARGUMENTS +.IP "ctx" 12 +Pointer of 'struct dmmp_context'. +.SH "DESCRIPTION" + +Release the memory of struct dmmp_context, but the userdata memory defined +via \fBdmmp_context_userdata_set\fP will not be touched. +.SH "RETURN" +void
libdmmp/docs/man/dmmp_context_log_func_set.3 new file +21 -0
@@ -0,0 +1,21 @@ +.TH "dmmp_context_log_func_set" 3 "dmmp_context_log_func_set" "March 2021" "Device Mapper Multipath API - libdmmp Manual" +.SH NAME +dmmp_context_log_func_set \- Set log handler function. +.SH SYNOPSIS +.B "void" dmmp_context_log_func_set +.BI "(struct dmmp_context *" ctx "," +.BI "void (*" log_func ") (struct dmmp_context *ctx, int priority, const char *file, int line, const char *func_name, const char *format, va_list args));" +.SH ARGUMENTS +.IP "ctx" 12 +Pointer of 'struct dmmp_context'. +If this pointer is NULL, your program will be terminated by assert. +.IP "log_func" 12 +Pointer of log handler function. If set to NULL, all log will be +ignored. +.SH "DESCRIPTION" + +Set custom log handler. The log handler will be invoked when log message +is equal or more important(less value) than log priority setting. +Please check manpage libdmmp.h(3) for detail usage. +.SH "RETURN" +void
libdmmp/docs/man/dmmp_context_log_priority_get.3 new file +23 -0
@@ -0,0 +1,23 @@ +.TH "dmmp_context_log_priority_get" 3 "dmmp_context_log_priority_get" "March 2021" "Device Mapper Multipath API - libdmmp Manual" +.SH NAME +dmmp_context_log_priority_get \- Get log priority. +.SH SYNOPSIS +.B "int" dmmp_context_log_priority_get +.BI "(struct dmmp_context *" ctx ");" +.SH ARGUMENTS +.IP "ctx" 12 +Pointer of 'struct dmmp_context'. +If this pointer is NULL, your program will be terminated by assert. +.SH "DESCRIPTION" + +Retrieve current log priority. Valid log priority values are: + +* DMMP_LOG_PRIORITY_ERROR -- 3 + +* DMMP_LOG_PRIORITY_WARNING -- 4 + +* DMMP_LOG_PRIORITY_INFO -- 5 + +* DMMP_LOG_PRIORITY_DEBUG -- 7 +.SH "RETURN" +int, log priority.
libdmmp/docs/man/dmmp_context_log_priority_set.3 new file +29 -0
@@ -0,0 +1,29 @@ +.TH "dmmp_context_log_priority_set" 3 "dmmp_context_log_priority_set" "March 2021" "Device Mapper Multipath API - libdmmp Manual" +.SH NAME +dmmp_context_log_priority_set \- Set log priority. +.SH SYNOPSIS +.B "void" dmmp_context_log_priority_set +.BI "(struct dmmp_context *" ctx "," +.BI "int " priority ");" +.SH ARGUMENTS +.IP "ctx" 12 +Pointer of 'struct dmmp_context'. +If this pointer is NULL, your program will be terminated by assert. +.IP "priority" 12 +int, log priority. +.SH "DESCRIPTION" + + +When library generates log message, only equal or more important(less value) +message will be forwarded to log handler function. Valid log priority values +are: + +* DMMP_LOG_PRIORITY_ERROR -- 3 + +* DMMP_LOG_PRIORITY_WARNING -- 4 + +* DMMP_LOG_PRIORITY_INFO -- 5 + +* DMMP_LOG_PRIORITY_DEBUG -- 7 +.SH "RETURN" +void
libdmmp/docs/man/dmmp_context_new.3 new file +19 -0
@@ -0,0 +1,19 @@ +.TH "dmmp_context_new" 3 "dmmp_context_new" "March 2021" "Device Mapper Multipath API - libdmmp Manual" +.SH NAME +dmmp_context_new \- Create struct dmmp_context. +.SH SYNOPSIS +.B "struct dmmp_context *" dmmp_context_new +.BI "(" void ");" +.SH ARGUMENTS +.IP "void" 12 +no arguments +.SH "DESCRIPTION" + +The default logging level (DMMP_LOG_PRIORITY_DEFAULT) is +DMMP_LOG_PRIORITY_WARNING which means only warning and error message will be +forward to log handler function. The default log handler function will print +log message to STDERR, to change so, please use \fBdmmp_context_log_func_set\fP +to set your own log handler, check manpage libdmmp.h(3) for detail. +.SH "RETURN" +Pointer of 'struct dmmp_context'. Should be freed by +\fBdmmp_context_free\fP.
libdmmp/docs/man/dmmp_context_timeout_get.3 new file +15 -0
@@ -0,0 +1,15 @@ +.TH "dmmp_context_timeout_get" 3 "dmmp_context_timeout_get" "March 2021" "Device Mapper Multipath API - libdmmp Manual" +.SH NAME +dmmp_context_timeout_get \- Get IPC timeout. +.SH SYNOPSIS +.B "unsigned int" dmmp_context_timeout_get +.BI "(struct dmmp_context *" ctx ");" +.SH ARGUMENTS +.IP "ctx" 12 +Pointer of 'struct dmmp_context'. +If this pointer is NULL, your program will be terminated by assert. +.SH "DESCRIPTION" + +Retrieve timeout value of IPC connection to multipathd daemon. +.SH "RETURN" +unsigned int. Timeout in milliseconds.
libdmmp/docs/man/dmmp_context_timeout_set.3 new file +19 -0
@@ -0,0 +1,19 @@ +.TH "dmmp_context_timeout_set" 3 "dmmp_context_timeout_set" "March 2021" "Device Mapper Multipath API - libdmmp Manual" +.SH NAME +dmmp_context_timeout_set \- Set IPC timeout. +.SH SYNOPSIS +.B "void" dmmp_context_timeout_set +.BI "(struct dmmp_context *" ctx "," +.BI "unsigned int " tmo ");" +.SH ARGUMENTS +.IP "ctx" 12 +Pointer of 'struct dmmp_context'. +If this pointer is NULL, your program will be terminated by assert. +.IP "tmo" 12 +Timeout in milliseconds(1 seconds equal 1000 milliseconds). +0 means infinite, function only return when error or pass. +.SH "DESCRIPTION" + +By default, the IPC to multipathd daemon will timeout after 60 seconds. +.SH "RETURN" +void
libdmmp/docs/man/dmmp_context_userdata_get.3 new file +15 -0
@@ -0,0 +1,15 @@ +.TH "dmmp_context_userdata_get" 3 "dmmp_context_userdata_get" "March 2021" "Device Mapper Multipath API - libdmmp Manual" +.SH NAME +dmmp_context_userdata_get \- Get user data pointer. +.SH SYNOPSIS +.B "void *" dmmp_context_userdata_get +.BI "(struct dmmp_context *" ctx ");" +.SH ARGUMENTS +.IP "ctx" 12 +Pointer of 'struct dmmp_context'. +If this pointer is NULL, your program will be terminated by assert. +.SH "DESCRIPTION" + +Retrieve user data pointer from 'struct dmmp_context'. +.SH "RETURN" +void *. Pointer of user defined data.
libdmmp/docs/man/dmmp_context_userdata_set.3 new file +18 -0
@@ -0,0 +1,18 @@ +.TH "dmmp_context_userdata_set" 3 "dmmp_context_userdata_set" "March 2021" "Device Mapper Multipath API - libdmmp Manual" +.SH NAME +dmmp_context_userdata_set \- Set user data pointer. +.SH SYNOPSIS +.B "void" dmmp_context_userdata_set +.BI "(struct dmmp_context *" ctx "," +.BI "void *" userdata ");" +.SH ARGUMENTS +.IP "ctx" 12 +Pointer of 'struct dmmp_context'. +If this pointer is NULL, your program will be terminated by assert. +.IP "userdata" 12 +Pointer of user defined data. +.SH "DESCRIPTION" + +Store user data pointer into 'struct dmmp_context'. +.SH "RETURN" +void
libdmmp/docs/man/dmmp_flush_mpath.3 new file +36 -0
@@ -0,0 +1,36 @@ +.TH "dmmp_flush_mpath" 3 "dmmp_flush_mpath" "March 2021" "Device Mapper Multipath API - libdmmp Manual" +.SH NAME +dmmp_flush_mpath \- Flush specified multipath device map if unused. +.SH SYNOPSIS +.B "int" dmmp_flush_mpath +.BI "(struct dmmp_context *" ctx "," +.BI "const char *" mpath_name ");" +.SH ARGUMENTS +.IP "ctx" 12 +Pointer of 'struct dmmp_context'. +If this pointer is NULL, your program will be terminated by assert. +.IP "mpath_name" 12 +const char *. The name of multipath device map. +.SH "DESCRIPTION" + +Flush a multipath device map specified as parameter, if unused. +.SH "RETURN" +int. Valid error codes are: + +* DMMP_OK + +* DMMP_ERR_BUG + +* DMMP_ERR_NO_MEMORY + +* DMMP_ERR_NO_DAEMON + +* DMMP_ERR_MPATH_BUSY + +* DMMP_ERR_MPATH_NOT_FOUND + +* DMMP_ERR_INVALID_ARGUMENT + +* DMMP_ERR_PERMISSION_DENY + +Error number could be converted to string by \fBdmmp_strerror\fP.
libdmmp/docs/man/dmmp_last_error_msg.3 new file +16 -0
@@ -0,0 +1,16 @@ +.TH "dmmp_last_error_msg" 3 "dmmp_last_error_msg" "March 2021" "Device Mapper Multipath API - libdmmp Manual" +.SH NAME +dmmp_last_error_msg \- Retrieves the last error message. +.SH SYNOPSIS +.B "const char *" dmmp_last_error_msg +.BI "(struct dmmp_context *" ctx ");" +.SH ARGUMENTS +.IP "ctx" 12 +Pointer of 'struct dmmp_context'. +If this pointer is NULL, your program will be terminated by assert. +.SH "DESCRIPTION" + +Retrieves the last error message. +.SH "RETURN" +const char *. No need to free this memory, the resources will get +freed when \fBdmmp_context_free\fP.
libdmmp/docs/man/dmmp_log_priority_str.3 new file +24 -0
@@ -0,0 +1,24 @@ +.TH "dmmp_log_priority_str" 3 "dmmp_log_priority_str" "March 2021" "Device Mapper Multipath API - libdmmp Manual" +.SH NAME +dmmp_log_priority_str \- Convert log priority to string. +.SH SYNOPSIS +.B "const char *" dmmp_log_priority_str +.BI "(int " priority ");" +.SH ARGUMENTS +.IP "priority" 12 +int. Log priority. +.SH "DESCRIPTION" + +Convert log priority to string (const char *). +.SH "RETURN" +const char *. Valid string are: + +* "ERROR" for DMMP_LOG_PRIORITY_ERROR + +* "WARN " for DMMP_LOG_PRIORITY_WARNING + +* "INFO " for DMMP_LOG_PRIORITY_INFO + +* "DEBUG" for DMMP_LOG_PRIORITY_DEBUG + +* "Invalid argument" for invalid log priority.
libdmmp/docs/man/dmmp_mpath_array_free.3 new file +18 -0
@@ -0,0 +1,18 @@ +.TH "dmmp_mpath_array_free" 3 "dmmp_mpath_array_free" "March 2021" "Device Mapper Multipath API - libdmmp Manual" +.SH NAME +dmmp_mpath_array_free \- Free 'struct dmmp_mpath' pointer array. +.SH SYNOPSIS +.B "void" dmmp_mpath_array_free +.BI "(struct dmmp_mpath **" dmmp_mps "," +.BI "uint32_t " dmmp_mp_count ");" +.SH ARGUMENTS +.IP "dmmp_mps" 12 +Pointer of 'struct dmmp_mpath' array. +.IP "dmmp_mp_count" 12 +uint32_t, the size of 'dmmp_mps' pointer array. +.SH "DESCRIPTION" + +Free the 'dmmp_mps' pointer array generated by \fBdmmp_mpath_array_get\fP. +If provided 'dmmp_mps' pointer is NULL or dmmp_mp_count == 0, do nothing. +.SH "RETURN" +void
libdmmp/docs/man/dmmp_mpath_array_get.3 new file +36 -0
@@ -0,0 +1,36 @@ +.TH "dmmp_mpath_array_get" 3 "dmmp_mpath_array_get" "March 2021" "Device Mapper Multipath API - libdmmp Manual" +.SH NAME +dmmp_mpath_array_get \- Query all existing multipath devices. +.SH SYNOPSIS +.B "int" dmmp_mpath_array_get +.BI "(struct dmmp_context *" ctx "," +.BI "struct dmmp_mpath ***" dmmp_mps "," +.BI "uint32_t *" dmmp_mp_count ");" +.SH ARGUMENTS +.IP "ctx" 12 +Pointer of 'struct dmmp_context'. +If this pointer is NULL, your program will be terminated by assert. +.IP "dmmp_mps" 12 +Output pointer array of 'struct dmmp_mpath'. +If this pointer is NULL, your program will be terminated by assert. +.IP "dmmp_mp_count" 12 +Output pointer of uint32_t. Hold the size of 'dmmp_mps' pointer array. +If this pointer is NULL, your program will be terminated by assert. +.SH "DESCRIPTION" + +Query all existing multipath devices and store them into a pointer array. +The memory of 'dmmp_mps' should be freed via \fBdmmp_mpath_array_free\fP. +.SH "RETURN" +int. Valid error codes are: + +* DMMP_OK + +* DMMP_ERR_BUG + +* DMMP_ERR_NO_MEMORY + +* DMMP_ERR_NO_DAEMON + +* DMMP_ERR_INCONSISTENT_DATA + +Error number could be converted to string by \fBdmmp_strerror\fP.
libdmmp/docs/man/dmmp_mpath_kdev_name_get.3 new file +17 -0
@@ -0,0 +1,17 @@ +.TH "dmmp_mpath_kdev_name_get" 3 "dmmp_mpath_kdev_name_get" "March 2021" "Device Mapper Multipath API - libdmmp Manual" +.SH NAME +dmmp_mpath_kdev_name_get \- Retrieve kernel DEVNAME of certain mpath. +.SH SYNOPSIS +.B "const char *" dmmp_mpath_kdev_name_get +.BI "(struct dmmp_mpath *" dmmp_mp ");" +.SH ARGUMENTS +.IP "dmmp_mp" 12 +Pointer of 'struct dmmp_mpath'. +If this pointer is NULL, your program will be terminated by assert. +.SH "DESCRIPTION" + +Retrieve DEVNAME name used by kernel uevent of specified mpath. +For example: 'dm-1'. +.SH "RETURN" +const char *. No need to free this memory, the resources will get +freed when \fBdmmp_mpath_array_free\fP.
libdmmp/docs/man/dmmp_mpath_name_get.3 new file +18 -0
@@ -0,0 +1,18 @@ +.TH "dmmp_mpath_name_get" 3 "dmmp_mpath_name_get" "March 2021" "Device Mapper Multipath API - libdmmp Manual" +.SH NAME +dmmp_mpath_name_get \- Retrieve name(alias) of certain mpath. +.SH SYNOPSIS +.B "const char *" dmmp_mpath_name_get +.BI "(struct dmmp_mpath *" dmmp_mp ");" +.SH ARGUMENTS +.IP "dmmp_mp" 12 +Pointer of 'struct dmmp_mpath'. +If this pointer is NULL, your program will be terminated by assert. +.SH "DESCRIPTION" + +Retrieve the name (also known as alias) of certain mpath. +When the config 'user_friendly_names' been set 'no', the name will be +identical to WWID retrieved by \fBdmmp_mpath_wwid_get\fP. +.SH "RETURN" +const char *. No need to free this memory, the resources will get +freed when \fBdmmp_mpath_array_free\fP.
libdmmp/docs/man/dmmp_mpath_wwid_get.3 new file +13 -0
@@ -0,0 +1,13 @@ +.TH "dmmp_mpath_wwid_get" 3 "dmmp_mpath_wwid_get" "March 2021" "Device Mapper Multipath API - libdmmp Manual" +.SH NAME +dmmp_mpath_wwid_get \- Retrieve WWID of certain mpath. +.SH SYNOPSIS +.B "const char *" dmmp_mpath_wwid_get +.BI "(struct dmmp_mpath *" dmmp_mp ");" +.SH ARGUMENTS +.IP "dmmp_mp" 12 +Pointer of 'struct dmmp_mpath'. +If this pointer is NULL, your program will be terminated by assert. +.SH "RETURN" +const char *. No need to free this memory, the resources will get +freed when \fBdmmp_mpath_array_free\fP.
libdmmp/docs/man/dmmp_path_array_get.3 new file +25 -0
@@ -0,0 +1,25 @@ +.TH "dmmp_path_array_get" 3 "dmmp_path_array_get" "March 2021" "Device Mapper Multipath API - libdmmp Manual" +.SH NAME +dmmp_path_array_get \- Retrieve path pointer array. +.SH SYNOPSIS +.B "void" dmmp_path_array_get +.BI "(struct dmmp_path_group *" dmmp_pg "," +.BI "struct dmmp_path ***" dmmp_ps "," +.BI "uint32_t *" dmmp_p_count ");" +.SH ARGUMENTS +.IP "dmmp_pg" 12 +Pointer of 'struct dmmp_path_group'. +If this pointer is NULL, your program will be terminated by assert. +.IP "dmmp_ps" 12 +Output pointer of 'struct dmmp_path' pointer array. +If this pointer is NULL, your program will be terminated by assert. +.IP "dmmp_p_count" 12 +Output pointer of uint32_t. Hold the size of 'dmmp_ps' pointer array. +If this pointer is NULL, your program will be terminated by assert. +.SH "DESCRIPTION" + +The memory of output pointer array is hold by 'struct dmmp_mpath', no +need to free this memory, the resources will got freed when +\fBdmmp_mpath_array_free\fP. +.SH "RETURN" +void
libdmmp/docs/man/dmmp_path_blk_name_get.3 new file +17 -0
@@ -0,0 +1,17 @@ +.TH "dmmp_path_blk_name_get" 3 "dmmp_path_blk_name_get" "March 2021" "Device Mapper Multipath API - libdmmp Manual" +.SH NAME +dmmp_path_blk_name_get \- Retrieve block name. +.SH SYNOPSIS +.B "const char *" dmmp_path_blk_name_get +.BI "(struct dmmp_path *" dmmp_p ");" +.SH ARGUMENTS +.IP "dmmp_p" 12 +Pointer of 'struct dmmp_path'. +If this pointer is NULL, your program will be terminated by assert. +.SH "DESCRIPTION" + +Retrieve block name of certain path. The example of block names are "sda", +"nvme0n1". +.SH "RETURN" +const char *. No need to free this memory, the resources will get +freed when \fBdmmp_mpath_array_free\fP.
libdmmp/docs/man/dmmp_path_group_array_get.3 new file +27 -0
@@ -0,0 +1,27 @@ +.TH "dmmp_path_group_array_get" 3 "dmmp_path_group_array_get" "March 2021" "Device Mapper Multipath API - libdmmp Manual" +.SH NAME +dmmp_path_group_array_get \- Retrieve path groups pointer array. +.SH SYNOPSIS +.B "void" dmmp_path_group_array_get +.BI "(struct dmmp_mpath *" dmmp_mp "," +.BI "struct dmmp_path_group ***" dmmp_pgs "," +.BI "uint32_t *" dmmp_pg_count ");" +.SH ARGUMENTS +.IP "dmmp_mp" 12 +Pointer of 'struct dmmp_mpath'. +If this pointer is NULL, your program will be terminated by assert. +.IP "dmmp_pgs" 12 +Output pointer of 'struct dmmp_path_group' pointer array. +If this pointer is NULL, your program will be terminated by assert. +.IP "dmmp_pg_count" 12 +Output pointer of uint32_t. Hold the size of 'dmmp_pgs' pointer array. +If this pointer is NULL, your program will be terminated by assert. +.SH "DESCRIPTION" + +Retrieve the path groups of certain mpath. + +The memory of output pointer array is hold by 'struct dmmp_mpath', no +need to free this memory, the resources will got freed when +\fBdmmp_mpath_array_free\fP. +.SH "RETURN" +void
libdmmp/docs/man/dmmp_path_group_id_get.3 new file +18 -0
@@ -0,0 +1,18 @@ +.TH "dmmp_path_group_id_get" 3 "dmmp_path_group_id_get" "March 2021" "Device Mapper Multipath API - libdmmp Manual" +.SH NAME +dmmp_path_group_id_get \- Retrieve path group ID. +.SH SYNOPSIS +.B "uint32_t" dmmp_path_group_id_get +.BI "(struct dmmp_path_group *" dmmp_pg ");" +.SH ARGUMENTS +.IP "dmmp_pg" 12 +Pointer of 'struct dmmp_path_group'. +If this pointer is NULL, your program will be terminated by assert. +.SH "DESCRIPTION" + +Retrieve the path group ID which could be used to switch active path group +via command: + +multipathd -k'switch multipath mpathb group $id' +.SH "RETURN" +uint32_t.
libdmmp/docs/man/dmmp_path_group_priority_get.3 new file +16 -0
@@ -0,0 +1,16 @@ +.TH "dmmp_path_group_priority_get" 3 "dmmp_path_group_priority_get" "March 2021" "Device Mapper Multipath API - libdmmp Manual" +.SH NAME +dmmp_path_group_priority_get \- Retrieve path group priority. +.SH SYNOPSIS +.B "uint32_t" dmmp_path_group_priority_get +.BI "(struct dmmp_path_group *" dmmp_pg ");" +.SH ARGUMENTS +.IP "dmmp_pg" 12 +Pointer of 'struct dmmp_path_group'. +If this pointer is NULL, your program will be terminated by assert. +.SH "DESCRIPTION" + +The enabled path group with highest priority will be next active path group +if active path group down. +.SH "RETURN" +uint32_t.
libdmmp/docs/man/dmmp_path_group_selector_get.3 new file +16 -0
@@ -0,0 +1,16 @@ +.TH "dmmp_path_group_selector_get" 3 "dmmp_path_group_selector_get" "March 2021" "Device Mapper Multipath API - libdmmp Manual" +.SH NAME +dmmp_path_group_selector_get \- Retrieve path group selector. +.SH SYNOPSIS +.B "const char *" dmmp_path_group_selector_get +.BI "(struct dmmp_path_group *" dmmp_pg ");" +.SH ARGUMENTS +.IP "dmmp_pg" 12 +Pointer of 'struct dmmp_path_group'. +If this pointer is NULL, your program will be terminated by assert. +.SH "DESCRIPTION" + +Path group selector determine which path in active path group will be +use to next I/O. +.SH "RETURN" +const char *.
libdmmp/docs/man/dmmp_path_group_status_get.3 new file +23 -0
@@ -0,0 +1,23 @@ +.TH "dmmp_path_group_status_get" 3 "dmmp_path_group_status_get" "March 2021" "Device Mapper Multipath API - libdmmp Manual" +.SH NAME +dmmp_path_group_status_get \- Retrieve path group status. +.SH SYNOPSIS +.B "uint32_t" dmmp_path_group_status_get +.BI "(struct dmmp_path_group *" dmmp_pg ");" +.SH ARGUMENTS +.IP "dmmp_pg" 12 +Pointer of 'struct dmmp_path_group'. +If this pointer is NULL, your program will be terminated by assert. +.SH "DESCRIPTION" + +The valid path group statuses are: + +* DMMP_PATH_GROUP_STATUS_UNKNOWN + +* DMMP_PATH_GROUP_STATUS_ENABLED -- standby to be active + +* DMMP_PATH_GROUP_STATUS_DISABLED -- disabled due to all path down + +* DMMP_PATH_GROUP_STATUS_ACTIVE -- selected to handle I/O +.SH "RETURN" +uint32_t.
libdmmp/docs/man/dmmp_path_group_status_str.3 new file +26 -0
@@ -0,0 +1,26 @@ +.TH "dmmp_path_group_status_str" 3 "dmmp_path_group_status_str" "March 2021" "Device Mapper Multipath API - libdmmp Manual" +.SH NAME +dmmp_path_group_status_str \- Convert path group status to string. +.SH SYNOPSIS +.B "const char *" dmmp_path_group_status_str +.BI "(uint32_t " pg_status ");" +.SH ARGUMENTS +.IP "pg_status" 12 +uint32_t. Path group status. +When provided value is not a valid path group status, return "Invalid +argument". +.SH "DESCRIPTION" + +Convert path group status uint32_t to string (const char *). +.SH "RETURN" +const char *. Valid string are: + +* "Invalid argument" + +* "undef" + +* "enabled" + +* "disabled" + +* "active"
libdmmp/docs/man/dmmp_path_status_get.3 new file +54 -0
54 lines not on this page · raw message
libdmmp/docs/man/dmmp_path_status_str.3 new file +34 -0
@@ -0,0 +1,34 @@ +.TH "dmmp_path_status_str" 3 "dmmp_path_status_str" "March 2021" "Device Mapper Multipath API - libdmmp Manual" +.SH NAME +dmmp_path_status_str \- Convert path status to string. +.SH SYNOPSIS +.B "const char *" dmmp_path_status_str +.BI "(uint32_t " path_status ");" +.SH ARGUMENTS +.IP "path_status" 12 +uint32_t. Path status. +When provided value is not a valid path status, return +"Invalid argument". +.SH "DESCRIPTION" + +Convert path status uint32_t to string (const char *): + +* DMMP_PATH_STATUS_UNKNOWN -- "undef" + +* DMMP_PATH_STATUS_DOWN -- "faulty" + +* DMMP_PATH_STATUS_UP -- "ready" + +* DMMP_PATH_STATUS_SHAKY -- "shaky" + +* DMMP_PATH_STATUS_GHOST -- "ghost" + +* DMMP_PATH_STATUS_PENDING -- "pending" + +* DMMP_PATH_STATUS_TIMEOUT -- "timeout" + +* DMMP_PATH_STATUS_REMOVED -- "removed" + +* DMMP_PATH_STATUS_DELAYED -- "delayed" +.SH "RETURN" +const char *. The meaning of status value.
libdmmp/docs/man/dmmp_reconfig.3 new file +27 -0
@@ -0,0 +1,27 @@ +.TH "dmmp_reconfig" 3 "dmmp_reconfig" "March 2021" "Device Mapper Multipath API - libdmmp Manual" +.SH NAME +dmmp_reconfig \- Instruct multipathd daemon to do reconfiguration. +.SH SYNOPSIS +.B "int" dmmp_reconfig +.BI "(struct dmmp_context *" ctx ");" +.SH ARGUMENTS +.IP "ctx" 12 +Pointer of 'struct dmmp_context'. +If this pointer is NULL, your program will be terminated by assert. +.SH "DESCRIPTION" + +Instruct multipathd daemon to do reconfiguration. +.SH "RETURN" +int. Valid error codes are: + +* DMMP_OK + +* DMMP_ERR_BUG + +* DMMP_ERR_NO_MEMORY + +* DMMP_ERR_NO_DAEMON + +* DMMP_ERR_PERMISSION_DENY + +Error number could be converted to string by \fBdmmp_strerror\fP.
libdmmp/docs/man/dmmp_strerror.3 new file +33 -0
@@ -0,0 +1,33 @@ +.TH "dmmp_strerror" 3 "dmmp_strerror" "March 2021" "Device Mapper Multipath API - libdmmp Manual" +.SH NAME +dmmp_strerror \- Convert error code to string. +.SH SYNOPSIS +.B "const char *" dmmp_strerror +.BI "(int " rc ");" +.SH ARGUMENTS +.IP "rc" 12 +int. Return code by libdmmp functions. When provided error code is not a +valid error code, return "Invalid argument". +.SH "DESCRIPTION" + +Convert error code (int) to string (const char *): + +* DMMP_OK -- "OK" + +* DMMP_ERR_BUG -- "BUG of libdmmp library" + +* DMMP_ERR_NO_MEMORY -- "Out of memory" + +* DMMP_ERR_IPC_TIMEOUT -- "Timeout when communicate with multipathd, +try to set bigger timeout value via dmmp_context_timeout_set ()" + +* DMMP_ERR_IPC_ERROR -- "Error when communicate with multipathd daemon" + +* DMMP_ERR_NO_DAEMON -- "The multipathd daemon not started" + +* DMMP_ERR_INCOMPATIBLE -- "The multipathd daemon version is not +compatible with current library" + +* Other invalid error number -- "Invalid argument" +.SH "RETURN" +const char *. The meaning of provided error code.
libdmmp/docs/man/libdmmp.h.3 renamed from libdmmp/docs/libdmmp.h.3 +0 -0
Signature · 7 lines
2.30.1 -- dm-devel mailing list [email protected] https://listman.redhat.com/mailman/listinfo/dm-devel
PATCH 3/7 github workflows: add containerized / multi-arch tests
In reply to [email protected]From: Martin Wilck <[email protected]>
Until now, our CI only tested builds on Ubuntu, the default github runner. This commit adds containerized build/test workflows, which can cover a much larger range of distributions and environments.
I've distinguished "native" runs, where the architecture is compatible with the architecture of the runners (assumed to be x86_64), and "foreign" runs with different architectures. The former can run "make test" just like in any ordinary environment. To run tests in "foreign arch" environments, I use qemu-user for runtime emulation. That's done with the help of the "multiarch/qemu-user-static" container. Runtime containers for testing need to have the qemu-user-static binary (compiled for x86_64) for their target architecture built in. In theory, we could do the same thing for build containers too, but it would be grossly inefficient. Instead, I've focused on Debian environments for the foreign architectures, relying on Debian's nice multiarch / cross-compilation features. Compilation is run in a dedicated cross-build container, and only the test runs are carried out in the emulation.
The set of tests currently includes:
native:
- Debian Jessie, x86_64/i386 (gcc 4.9, clang 3.5, glibc 2.19)
- Debian Buster, x86_64/i386 (gcc 8.3, clang 7.0, glibc 2.28)
- Debian Sid, x86_64/i386 (gcc 10.2, clang 11.0, glibc 2.31)
- Alpine, x86_64/i386 (gcc 10.2, clang 10.0, musl libc 1.2)
- Fedora 34, x86_64 (gcc 11.0, clang 12.0, glibc 2.33)
foreign:
- Debian Buster, ppc64le/aarch64/s390x
This covers a rather broad range of compiler and C library versions and should be fine for some time to come.
Note: In theory, it would be possible to just fetch base containers via github actions, and install the dependencies as part of the build procedure. But that would be quite resource-intensive and slow. Therefore I've decided to use pre-built containers. The current container setup fetches containers from my docker hub repository. The containers there (multipath-build-$os-$arch and multipath-run-$os-$arch) come from my "build-multipath" repository (https://github.com/mwilck/build-multipath),
and are created via github actions, too. The upload of the built container images to docker hub requires the use of tokens and secrets.
I'd considered adding these container definitions and workflows to the multipath-tools repository. We'd just need to create reasonable rules for running the respective workflows. I expect these container images to remain relatively stable; it makes no sense to rebuild the images for every multipath-tools commit.
Tell me if you want this in the multipath-tools repo, and if you're ok with hosting the images in my docker hub repo.
--- .github/workflows/build-and-unittest.yaml | 4 +- .github/workflows/foreign.yaml | 65 +++++++++++++++++++++++ .github/workflows/native.yaml | 31 +++++++++++ 3 files changed, 99 insertions(+), 1 deletion(-) create mode 100644 .github/workflows/foreign.yaml create mode 100644 .github/workflows/native.yaml
.github/workflows/build-and-unittest.yaml +3 -1
@@ -1,5 +1,7 @@ name: basic-build-and-ci -on: [push] +on: + push: + branches: [master queue tip] jobs: bionic: runs-on: ubuntu-18.04
.github/workflows/foreign.yaml new file +65 -0
65 lines not on this page · raw message
.github/workflows/native.yaml new file +31 -0
@@ -0,0 +1,31 @@ +name: compile and unit test on native arch +on: + push: + branches: + - master + - queue + - tip + +jobs: + build-and-test: + runs-on: ubuntu-20.04 + strategy: + matrix: + os: [buster, jessie, sid, alpine, fedora-34] + arch: ['', '-i386'] + exclude: + - os: fedora-34 + arch: '-i386' + container: mwilck/multipath-build-${{ matrix.os }}${{ matrix.arch }} + steps: + - name: checkout + uses: actions/checkout@v1 + - name: build and test + run: make test + - name: clean + run: make clean + - name: clang + env: + CC: clang + run: make test +
Signature · 7 lines
2.30.1 -- dm-devel mailing list [email protected] https://listman.redhat.com/mailman/listinfo/dm-devel
PATCH 2/7 multipath-tools Makefiles: allow building test programs only
In reply to [email protected]From: Martin Wilck <[email protected]>
"make test" builds and runs test programs. For multiarch / cross-compilation environments, it's useful to be able to separate these steps.
--- Makefile | 7 +++++-- tests/Makefile | 1 + 2 files changed, 6 insertions(+), 2 deletions(-)
Makefile +5 -2
@@ -51,8 +51,11 @@ clean: $(BUILDDIRS.clean) install: $(BUILDDIRS:=.install) uninstall: $(BUILDDIRS:=.uninstall) -test: all - $(MAKE) -C tests +test-progs: all + $(MAKE) -C tests progs + +test: test-progs + $(MAKE) -C tests all valgrind-test: all $(MAKE) -C tests valgrind
tests/Makefile +1 -0
@@ -20,6 +20,7 @@ HELPERS := test-lib.o test-log.o .PRECIOUS: $(TESTS:%=%-test) all: $(TESTS:%=%.out) +progs: $(TESTS:%=%-test) lib/libchecktur.so valgrind: $(TESTS:%=%.vgr) # test-specific compiler flags
Signature · 7 lines
2.30.1 -- dm-devel mailing list [email protected] https://listman.redhat.com/mailman/listinfo/dm-devel
PATCH 5/7 multipath-tools Makefile: build before install
In reply to [email protected]From: Martin Wilck <[email protected]>
"make install" in a clean directory fails. Fix it by making "all" a dependency of "install".
--- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
Makefile +1 -1
@@ -48,7 +48,7 @@ $(BUILDDIRS:=.uninstall): $(MAKE) -C ${@:.uninstall=} uninstall clean: $(BUILDDIRS.clean) -install: $(BUILDDIRS:=.install) +install: all $(BUILDDIRS:=.install) uninstall: $(BUILDDIRS:=.uninstall) test-progs: all
Signature · 7 lines
2.30.1 -- dm-devel mailing list [email protected] https://listman.redhat.com/mailman/listinfo/dm-devel
PATCH 7/7 libmultipath: fix warning with clang 3.5
In reply to [email protected]From: Martin Wilck <[email protected]>
Fixes the following warning with clang 3.5:
io_err_stat.c:613:31: error: missing field 'slot' initializer [-Werror,-Wmissing-field-initializers]
struct _vector _pathvec = {0,};--- libmultipath/io_err_stat.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
libmultipath/io_err_stat.c +1 -1
@@ -610,7 +610,7 @@ static void process_async_ios_event(int timeout_nsecs, char *dev)static void service_paths (void ) { -struct _vector _pathvec = {0 }; +struct _vector _pathvec = { .allocated =0 };/* avoid gcc warnings that &_pathvec will never be NULL in vector ops */ struct _vector *const tmp_pathvec = &_pathvec;struct io_err_stat_path *pp;
Signature · 7 lines
2.30.1 -- dm-devel mailing list [email protected] https://listman.redhat.com/mailman/listinfo/dm-devel
PATCH 6/7 fixup "multipath-tools tests: check if /sys/dev/block is non-empty"
In reply to [email protected]From: Martin Wilck <[email protected]>
Don't run closedir() if opendir() failed.
--- tests/devt.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
tests/devt.c +1 -1
@@ -37,8 +37,8 @@ static bool sys_dev_block_exists(void)break ; } } +closedir (dir); } -closedir (dir);return rc; }
Signature · 7 lines
2.30.1 -- dm-devel mailing list [email protected] https://listman.redhat.com/mailman/listinfo/dm-devel
PATCH 1/7 multipath-tools Makefiles: make pkg-config configurable
In reply to [email protected]From: Martin Wilck <[email protected]>
This is useful for building in a cross-compilation environment.
--- Makefile.inc | 6 ++++-- libdmmp/Makefile | 4 ++-- 2 files changed, 6 insertions(+), 4 deletions(-)
Makefile.inc +4 -2
@@ -15,6 +15,8 @@ # Uncomment to disable dmevents polling support # ENABLE_DMEVENTS_POLL = 0 +PKGCONFIG ?= pkg-config + ifeq ($(TOPDIR),) TOPDIR = .. endif
@@ -36,8 +38,8 @@ ifndef RUN endif ifndef SYSTEMD - ifeq ($(shell pkg-config --modversion libsystemd >/dev/null 2>&1 && echo 1), 1) - SYSTEMD = $(shell pkg-config --modversion libsystemd | awk '{print $$1}') + ifeq ($(shell $(PKGCONFIG) --modversion libsystemd >/dev/null 2>&1 && echo 1), 1) + SYSTEMD = $(shell $(PKGCONFIG) --modversion libsystemd | awk '{print $$1}') else ifeq ($(shell systemctl --version >/dev/null 2>&1 && echo 1), 1) SYSTEMD = $(shell systemctl --version 2> /dev/null | \
libdmmp/Makefile +2 -2
@@ -16,9 +16,9 @@ HEADERS = libdmmp/libdmmp.h OBJS = libdmmp.o libdmmp_mp.o libdmmp_pg.o libdmmp_path.o libdmmp_misc.o CFLAGS += $(LIB_CFLAGS) -fvisibility=hidden -I$(libdmmpdir) -I$(mpathcmddir) \ - $(shell pkg-config --cflags json-c) + $(shell $(PKGCONFIG) --cflags json-c) -LIBDEPS += $(shell pkg-config --libs json-c) -L$(mpathcmddir) -lmpathcmd -lpthread +LIBDEPS += $(shell $(PKGCONFIG) --libs json-c) -L$(mpathcmddir) -lmpathcmd -lpthread all: $(LIBS) doc
Signature · 7 lines
2.30.1 -- dm-devel mailing list [email protected] https://listman.redhat.com/mailman/listinfo/dm-devel
Re: [dm-devel] [PATCH 1/7] multipath-tools Makefiles: make pkg-config configurable
Quoted 3 lines · On 3/26/21 10:29 PM, [email protected] wrote:
From: Martin Wilck <[email protected]>
This is useful for building in a cross-compilation environment.
Debian has a similar patch:
https://salsa.debian.org/linux-blocks-team/multipath-tools/-/blob/master/debian/patches/0008-Bug-916521-FTCBFS-uses-the-wrong-pkg-config.patch
Quoted 37 lines
Signed-off-by Martin Wilck <[email protected]>--- Makefile.inc | 6 ++++-- libdmmp/Makefile | 4 ++-- 2 files changed, 6 insertions(+), 4 deletions(-)Makefile.inc +4
-2@@ -15,6 +15,8 @@ # Uncomment to disable dmevents polling support # ENABLE_DMEVENTS_POLL = 0 +PKGCONFIG ?= pkg-config + ifeq ($(TOPDIR),) TOPDIR = .. endif@@ -36,8 +38,8 @@ ifndef RUN endif ifndef SYSTEMD - ifeq ($(shell pkg-config --modversion libsystemd >/dev/null 2>&1 && echo 1), 1) - SYSTEMD = $(shell pkg-config --modversion libsystemd | awk '{print $$1}') + ifeq ($(shell $(PKGCONFIG) --modversion libsystemd >/dev/null 2>&1 && echo 1), 1) + SYSTEMD = $(shell $(PKGCONFIG) --modversion libsystemd | awk '{print $$1}') else ifeq ($(shell systemctl --version >/dev/null 2>&1 && echo 1), 1) SYSTEMD = $(shell systemctl --version 2> /dev/null | \libdmmp/Makefile +0
-0@@ -16,9 +16,9 @@ HEADERS = libdmmp/libdmmp.h OBJS = libdmmp.o libdmmp_mp.o libdmmp_pg.o libdmmp_path.o libdmmp_misc.o
libdmmp/Makefile HEADERS = libdmmp/libdmmp.h · line 24
Quoted 10 lines
libdmmp/Makefile +2
-2CFLAGS += $(LIB_CFLAGS) -fvisibility=hidden -I$(libdmmpdir) -I$(mpathcmddir) \ - $(shell pkg-config --cflags json-c) + $(shell $(PKGCONFIG) --cflags json-c) -LIBDEPS += $(shell pkg-config --libs json-c) -L$(mpathcmddir) -lmpathcmd -lpthread +LIBDEPS += $(shell $(PKGCONFIG) --libs json-c) -L$(mpathcmddir) -lmpathcmd -lpthread all: $(LIBS) doc
--
dm-devel mailing list
[email protected]
https://listman.redhat.com/mailman/listinfo/dm-devel
Re: [dm-devel] [PATCH 1/7] multipath-tools Makefiles: make pkg-config configurable
Quoted 8 lines · Xose Vazquez Perez
Quoted 3 lines · On 3/26/21 10:29 PM, [email protected] wrote:
From: Martin Wilck <[email protected]>
This is useful for building in a cross-compilation environment.
Debian has a similar patch:
https://salsa.debian.org/linux-blocks-team/multipath-tools/-/blob/master/debian/patches/0008-Bug-916521-FTCBFS-uses-the-wrong-pkg-config.patch
Does this mean you disapprove of mine?
Martin
--
dm-devel mailing list
[email protected]
https://listman.redhat.com/mailman/listinfo/dm-devel
Benjamin Marzinski
maintainerRe: [dm-devel] [PATCH 3/7] github workflows: add containerized / multi-arch tests
In reply to [email protected]Quoted 44 lines · On Fri, Mar 26, 2021 at 10:29:40PM +0100, [email protected] wrote:
From: Martin Wilck <[email protected]>
Until now, our CI only tested builds on Ubuntu, the default github runner. This commit adds containerized build/test workflows, which can cover a much larger range of distributions and environments.
I've distinguished "native" runs, where the architecture is compatible with the architecture of the runners (assumed to be
x86_64), and "foreign" runs with different architectures. The former can run "make test" just like in any ordinary environment. To run tests in "foreign arch" environments, I use qemu-user for runtime emulation. That's done with the help of the "multiarch/qemu-user-static" container. Runtime containers for testing need to have the qemu-user-static binary (compiled forx86_64) for their target architecture built in. In theory, we could do the same thing for build containers too, but it would be grossly inefficient. Instead, I've focused on Debian environments for the foreign architectures, relying on Debian's nice multiarch / cross-compilation features. Compilation is run in a dedicated cross-build container, and only the test runs are carried out in the emulation.The set of tests currently includes:
native:
- Debian Jessie, x86_64/i386 (gcc 4.9, clang 3.5, glibc 2.19)
- Debian Buster, x86_64/i386 (gcc 8.3, clang 7.0, glibc 2.28)
- Debian Sid, x86_64/i386 (gcc 10.2, clang 11.0, glibc 2.31)
- Alpine, x86_64/i386 (gcc 10.2, clang 10.0, musl libc 1.2)
- Fedora 34,x86_64(gcc 11.0, clang 12.0, glibc 2.33)foreign:
- Debian Buster, ppc64le/aarch64/s390xThis covers a rather broad range of compiler and C library versions and should be fine for some time to come.
Note: In theory, it would be possible to just fetch base containers via github actions, and install the dependencies as part of the build procedure. But that would be quite resource-intensive and slow. Therefore I've decided to use pre-built containers. The current container setup fetches containers from my docker hub repository. The containers there (multipath-build-$os-$arch and multipath-run-$os-$arch) come from my "build-multipath" repository (https://github.com/mwilck/build-multipath),
and are created via github actions, too. The upload of the built container images to docker hub requires the use of tokens and secrets.
Quoted 8 lines
I'd considered adding these container definitions and workflows to the multipath-tools repository. We'd just need to create reasonable rules for running the respective workflows. I expect these container images to remain relatively stable; it makes no sense to rebuild the images for every multipath-tools commit.
Tell me if you want this in the multipath-tools repo, and if you're ok with hosting the images in my docker hub repo.
I don't have problems with this setup. I haven't really looked into github actions, and so really don't know how easy it setup rules to run actions on events other that pushes, pull requests, etc. It seems reasonable to store those in a seperate repository. It would probably be good to have Christophe weigh in as well before adding these. Although I suppose it's always possible to disable these actions in other repos.
-Ben
Quoted 132 lines
Signed-off-by Martin Wilck <[email protected]>--- .github/workflows/build-and-unittest.yaml | 4 +- .github/workflows/foreign.yaml | 65 +++++++++++++++++++++++ .github/workflows/native.yaml | 31 +++++++++++ 3 files changed, 99 insertions(+), 1 deletion(-) create mode 100644 .github/workflows/foreign.yaml create mode 100644 .github/workflows/native.yaml.github/workflows/build-and-unittest.yaml +3
-1@@ -1,5 +1,7 @@ name: basic-build-and-ci -on: [push] +on: + push: + branches: [master queue tip] jobs: bionic: runs-on: ubuntu-18.04.github/workflows/foreign.yaml new file +65
-0@@ -0,0 +1,65 @@ +name: compile and unit test on foreign arch +on: + push: + branches: + - master + - queue + - tip + +jobs: + + build: + runs-on: ubuntu-20.04 + strategy: + matrix: + os: [buster] + arch: ['ppc64le', 'aarch64', 's390x'] + container: mwilck/multipath-build-${{ matrix.os }}-${{ matrix.arch }} + steps: + - name: checkout + uses: actions/checkout@v1 + - name: build and test + if: ${{ matrix.arch == '' || matrix.arch == '-i386' }} + run: make test + - name: build + if: ${{ matrix.arch != '' && matrix.arch != '-i386' }} + run: make test-progs + - name: archive + if: ${{ matrix.arch != '' && matrix.arch != '-i386' }} + run: > + tar cfv binaries.tar + Makefile* + libmpathcmd/*.so* libmultipath/*.so* + tests/lib tests/*-test tests/Makefile tests/*.so* + - uses: actions/upload-artifact@v1 + if: ${{ matrix.arch != '' && matrix.arch != '-i386' }} + with: + name: multipath-${{ matrix.os }}-${{ matrix.arch }} + path: binaries.tar + + test: + runs-on: ubuntu-20.04 + needs: build + strategy: + matrix: + os: [buster] + arch: ['ppc64le', 'aarch64', 's390x'] + steps: + - name: get binaries + uses: actions/download-artifact@v1 + with: + name: multipath-${{ matrix.os }}-${{ matrix.arch }} + - name: unpack + run: tar xfv multipath-${{ matrix.os }}-${{ matrix.arch }}/binaries.tar + - name: enable foreign arch + run: sudo docker run --rm --privileged multiarch/qemu-user-static:register --reset + - name: run tests + # Github actions doesn't support referencing docker images with + # context variables. Workaround: use mosteo-actions/docker-run action + # See https://github.community/t/expressions-in-docker-uri/16271 + uses: mosteo-actions/docker-run@v1 + with: + image: mwilck/multipath-run-${{ matrix.os }}-${{ matrix.arch }} + # The runner is an image that has "make" as entrypoint + # So run "make -C tests" here + command: -C tests.github/workflows/native.yaml new file +31
-0@@ -0,0 +1,31 @@ +name: compile and unit test on native arch +on: + push: + branches: + - master + - queue + - tip + +jobs: + build-and-test: + runs-on: ubuntu-20.04 + strategy: + matrix: + os: [buster, jessie, sid, alpine, fedora-34] + arch: ['', '-i386'] + exclude: + - os: fedora-34 + arch: '-i386' + container: mwilck/multipath-build-${{ matrix.os }}${{ matrix.arch }} + steps: + - name: checkout + uses: actions/checkout@v1 + - name: build and test + run: make test + - name: clean + run: make clean + - name: clang + env: + CC: clang + run: make test +Signature · 1 line
2.30.1
--
dm-devel mailing list
[email protected]
https://listman.redhat.com/mailman/listinfo/dm-devel
Benjamin Marzinski
maintainerRe: [dm-devel] [PATCH 4/7] libdmmp: allow building without perl
In reply to [email protected]Quoted 7 lines · On Fri, Mar 26, 2021 at 10:29:41PM +0100, [email protected] wrote:
From: Martin Wilck <[email protected]>
Add the kernel-doc generated manpages of libdmmp to git, and change the libdmmp
Makefileto regenerate them (only) when necessary.This allows us to drop perl as a build-time requirement.
Git complains about a bunch of trailing whitespace issues here, but this is a great idea.
-Ben
Quoted 990 lines
Signed-off-by Martin Wilck <[email protected]>--- libdmmp/Makefile | 37 ++++++------- libdmmp/docs/man/dmmp_context_free.3 | 15 ++++++ libdmmp/docs/man/dmmp_context_log_func_set.3 | 21 ++++++++ .../docs/man/dmmp_context_log_priority_get.3 | 23 ++++++++ .../docs/man/dmmp_context_log_priority_set.3 | 29 ++++++++++ libdmmp/docs/man/dmmp_context_new.3 | 19 +++++++ libdmmp/docs/man/dmmp_context_timeout_get.3 | 15 ++++++ libdmmp/docs/man/dmmp_context_timeout_set.3 | 19 +++++++ libdmmp/docs/man/dmmp_context_userdata_get.3 | 15 ++++++ libdmmp/docs/man/dmmp_context_userdata_set.3 | 18 +++++++ libdmmp/docs/man/dmmp_flush_mpath.3 | 36 +++++++++++++ libdmmp/docs/man/dmmp_last_error_msg.3 | 16 ++++++ libdmmp/docs/man/dmmp_log_priority_str.3 | 24 +++++++++ libdmmp/docs/man/dmmp_mpath_array_free.3 | 18 +++++++ libdmmp/docs/man/dmmp_mpath_array_get.3 | 36 +++++++++++++ libdmmp/docs/man/dmmp_mpath_kdev_name_get.3 | 17 ++++++ libdmmp/docs/man/dmmp_mpath_name_get.3 | 18 +++++++ libdmmp/docs/man/dmmp_mpath_wwid_get.3 | 13 +++++ libdmmp/docs/man/dmmp_path_array_get.3 | 25 +++++++++ libdmmp/docs/man/dmmp_path_blk_name_get.3 | 17 ++++++ libdmmp/docs/man/dmmp_path_group_array_get.3 | 27 ++++++++++ libdmmp/docs/man/dmmp_path_group_id_get.3 | 18 +++++++ .../docs/man/dmmp_path_group_priority_get.3 | 16 ++++++ .../docs/man/dmmp_path_group_selector_get.3 | 16 ++++++ libdmmp/docs/man/dmmp_path_group_status_get.3 | 23 ++++++++ libdmmp/docs/man/dmmp_path_group_status_str.3 | 26 +++++++++ libdmmp/docs/man/dmmp_path_status_get.3 | 54 +++++++++++++++++++ libdmmp/docs/man/dmmp_path_status_str.3 | 34 ++++++++++++ libdmmp/docs/man/dmmp_reconfig.3 | 27 ++++++++++ libdmmp/docs/man/dmmp_strerror.3 | 33 ++++++++++++ libdmmp/docs/{ => man}/libdmmp.h.3 | 0 31 files changed, 683 insertions(+), 22 deletions(-) create mode 100644 libdmmp/docs/man/dmmp_context_free.3 create mode 100644 libdmmp/docs/man/dmmp_context_log_func_set.3 create mode 100644 libdmmp/docs/man/dmmp_context_log_priority_get.3 create mode 100644 libdmmp/docs/man/dmmp_context_log_priority_set.3 create mode 100644 libdmmp/docs/man/dmmp_context_new.3 create mode 100644 libdmmp/docs/man/dmmp_context_timeout_get.3 create mode 100644 libdmmp/docs/man/dmmp_context_timeout_set.3 create mode 100644 libdmmp/docs/man/dmmp_context_userdata_get.3 create mode 100644 libdmmp/docs/man/dmmp_context_userdata_set.3 create mode 100644 libdmmp/docs/man/dmmp_flush_mpath.3 create mode 100644 libdmmp/docs/man/dmmp_last_error_msg.3 create mode 100644 libdmmp/docs/man/dmmp_log_priority_str.3 create mode 100644 libdmmp/docs/man/dmmp_mpath_array_free.3 create mode 100644 libdmmp/docs/man/dmmp_mpath_array_get.3 create mode 100644 libdmmp/docs/man/dmmp_mpath_kdev_name_get.3 create mode 100644 libdmmp/docs/man/dmmp_mpath_name_get.3 create mode 100644 libdmmp/docs/man/dmmp_mpath_wwid_get.3 create mode 100644 libdmmp/docs/man/dmmp_path_array_get.3 create mode 100644 libdmmp/docs/man/dmmp_path_blk_name_get.3 create mode 100644 libdmmp/docs/man/dmmp_path_group_array_get.3 create mode 100644 libdmmp/docs/man/dmmp_path_group_id_get.3 create mode 100644 libdmmp/docs/man/dmmp_path_group_priority_get.3 create mode 100644 libdmmp/docs/man/dmmp_path_group_selector_get.3 create mode 100644 libdmmp/docs/man/dmmp_path_group_status_get.3 create mode 100644 libdmmp/docs/man/dmmp_path_group_status_str.3 create mode 100644 libdmmp/docs/man/dmmp_path_status_get.3 create mode 100644 libdmmp/docs/man/dmmp_path_status_str.3 create mode 100644 libdmmp/docs/man/dmmp_reconfig.3 create mode 100644 libdmmp/docs/man/dmmp_strerror.3 rename libdmmp/docs/{ => man}/libdmmp.h.3 (100%)libdmmp/Makefile +15
-22@@ -21,12 +21,13 @@ CFLAGS += $(LIB_CFLAGS) -fvisibility=hidden -I$(libdmmpdir) -I$(mpathcmddir) \ LIBDEPS += $(shell $(PKGCONFIG) --libs json-c) -L$(mpathcmddir) -lmpathcmd -lpthread all: $(LIBS) doc +.PHONY: doc doc.gz clean install uninstall check speed_test dep_clean $(LIBS): $(OBJS) $(CC) $(LDFLAGS) $(SHARED_FLAGS) -Wl,-soname=$@ -o $@ $(OBJS) $(LIBDEPS) $(LN) $@ $(DEVLIB) -install: +install: doc.gz mkdir -p $(DESTDIR)$(usrlibdir) $(INSTALL_PROGRAM) -m 755 $(LIBS) $(DESTDIR)$(usrlibdir)/$(LIBS) $(INSTALL_PROGRAM) -m 644 -D \@@ -40,11 +41,7 @@ install: $(DESTDIR)$(pkgconfdir)/$(PKGFILE) perl -i -pe 's|__INCLUDEDIR__|$(includedir)|g' \ $(DESTDIR)$(pkgconfdir)/$(PKGFILE) - @for file in docs/man/*.3.gz; do \ - $(INSTALL_PROGRAM) -m 644 -D \ - $$file \ - $(DESTDIR)$(man3dir)/ || exit $?; \ - done + $(INSTALL_PROGRAM) -m 644 -t $(DESTDIR)$(man3dir) docs/man/*.3.gz uninstall: $(RM) $(DESTDIR)$(usrlibdir)/$(LIBS)@@ -58,7 +55,7 @@ uninstall: clean: dep_clean $(RM) core *.a *.o *.gz *.so *.so.* - $(RM) -r docs/man + $(RM) docs/man/*.gz $(MAKE) -C test clean include $(wildcard $(OBJS:.o=.d))@@ -69,23 +66,19 @@ check: all speed_test: all $(MAKE) -C test speed_test -doc: docs/man/$(EXTRA_MAN_FILES).gz +doc.gz: doc $(patsubst %,%.gz,$(wildcard docs/man/*.3)) -TEMPFILE := $(shell mktemp) +doc: docs/man/dmmp_strerror.3 -docs/man/$(EXTRA_MAN_FILES).gz: $(HEADERS) - @for file in $(EXTRA_MAN_FILES); do \ - $(INSTALL_PROGRAM) -v -m 644 -D docs/$$file docs/man/$$file; \ - done - cat $(HEADERS) | \ - perl docs/doc-preclean.pl > "$(TEMPFILE)" - perl docs/kernel-doc -man "$(TEMPFILE)" | \ - perl docs/split-man.pl docs/man - -rm -f "$(TEMPFILE)" - @for file in docs/man/*.3; do \ - gzip -f $$file; \ - done - find docs/man -type f -name \*[0-9].gz +docs/man/%.3.gz: docs/man/%.3 + gzip -c $< >$@ + +docs/man/dmmp_strerror.3: $(HEADERS) + TEMPFILE=$(shell mktemp); \ + cat $^ | perl docs/doc-preclean.pl >$$TEMPFILE; \ + perl docs/kernel-doc -man $$TEMPFILE | \ + perl docs/split-man.pl docs/man; \ + rm -f $$TEMPFILE dep_clean: $(RM) $(OBJS:.o=.d)libdmmp/docs/man/dmmp_context_free.3 new file +15
-0@@ -0,0 +1,15 @@ +.TH "dmmp_context_free" 3 "dmmp_context_free" "March 2021" "Device Mapper Multipath API - libdmmp Manual" +.SH NAME +dmmp_context_free \- Release the memory of struct dmmp_context. +.SH SYNOPSIS +.B "void" dmmp_context_free +.BI "(struct dmmp_context *" ctx ");" +.SH ARGUMENTS +.IP "ctx" 12 +Pointer of 'struct dmmp_context'. +.SH "DESCRIPTION" + +Release the memory of struct dmmp_context, but the userdata memory defined +via \fBdmmp_context_userdata_set\fP will not be touched. +.SH "RETURN" +voidlibdmmp/docs/man/dmmp_context_log_func_set.3 new file +21
-0@@ -0,0 +1,21 @@ +.TH "dmmp_context_log_func_set" 3 "dmmp_context_log_func_set" "March 2021" "Device Mapper Multipath API - libdmmp Manual" +.SH NAME +dmmp_context_log_func_set \- Set log handler function. +.SH SYNOPSIS +.B "void" dmmp_context_log_func_set +.BI "(struct dmmp_context *" ctx "," +.BI "void (*" log_func ") (struct dmmp_context *ctx, int priority, const char *file, int line, const char *func_name, const char *format, va_list args));" +.SH ARGUMENTS +.IP "ctx" 12 +Pointer of 'struct dmmp_context'. +If this pointer is NULL, your program will be terminated by assert. +.IP "log_func" 12 +Pointer of log handler function. If set to NULL, all log will be +ignored. +.SH "DESCRIPTION" + +Set custom log handler. The log handler will be invoked when log message +is equal or more important(less value) than log priority setting. +Please check manpage libdmmp.h(3) for detail usage. +.SH "RETURN" +voidlibdmmp/docs/man/dmmp_context_log_priority_get.3 new file +23
-0@@ -0,0 +1,23 @@ +.TH "dmmp_context_log_priority_get" 3 "dmmp_context_log_priority_get" "March 2021" "Device Mapper Multipath API - libdmmp Manual" +.SH NAME +dmmp_context_log_priority_get \- Get log priority. +.SH SYNOPSIS +.B "int" dmmp_context_log_priority_get +.BI "(struct dmmp_context *" ctx ");" +.SH ARGUMENTS +.IP "ctx" 12 +Pointer of 'struct dmmp_context'. +If this pointer is NULL, your program will be terminated by assert. +.SH "DESCRIPTION" + +Retrieve current log priority. Valid log priority values are: + +* DMMP_LOG_PRIORITY_ERROR -- 3 + +* DMMP_LOG_PRIORITY_WARNING -- 4 + +* DMMP_LOG_PRIORITY_INFO -- 5 + +* DMMP_LOG_PRIORITY_DEBUG -- 7 +.SH "RETURN" +int, log priority.libdmmp/docs/man/dmmp_context_log_priority_set.3 new file +29
-0@@ -0,0 +1,29 @@ +.TH "dmmp_context_log_priority_set" 3 "dmmp_context_log_priority_set" "March 2021" "Device Mapper Multipath API - libdmmp Manual" +.SH NAME +dmmp_context_log_priority_set \- Set log priority. +.SH SYNOPSIS +.B "void" dmmp_context_log_priority_set +.BI "(struct dmmp_context *" ctx "," +.BI "int " priority ");" +.SH ARGUMENTS +.IP "ctx" 12 +Pointer of 'struct dmmp_context'. +If this pointer is NULL, your program will be terminated by assert. +.IP "priority" 12 +int, log priority. +.SH "DESCRIPTION" + + +When library generates log message, only equal or more important(less value) +message will be forwarded to log handler function. Valid log priority values +are: + +* DMMP_LOG_PRIORITY_ERROR -- 3 + +* DMMP_LOG_PRIORITY_WARNING -- 4 + +* DMMP_LOG_PRIORITY_INFO -- 5 + +* DMMP_LOG_PRIORITY_DEBUG -- 7 +.SH "RETURN" +voidlibdmmp/docs/man/dmmp_context_new.3 new file +19
-0@@ -0,0 +1,19 @@ +.TH "dmmp_context_new" 3 "dmmp_context_new" "March 2021" "Device Mapper Multipath API - libdmmp Manual" +.SH NAME +dmmp_context_new \- Create struct dmmp_context. +.SH SYNOPSIS +.B "struct dmmp_context *" dmmp_context_new +.BI "(" void ");" +.SH ARGUMENTS +.IP "void" 12 +no arguments +.SH "DESCRIPTION" + +The default logging level (DMMP_LOG_PRIORITY_DEFAULT) is +DMMP_LOG_PRIORITY_WARNING which means only warning and error message will be +forward to log handler function. The default log handler function will print +log message to STDERR, to change so, please use \fBdmmp_context_log_func_set\fP +to set your own log handler, check manpage libdmmp.h(3) for detail. +.SH "RETURN" +Pointer of 'struct dmmp_context'. Should be freed by +\fBdmmp_context_free\fP.libdmmp/docs/man/dmmp_context_timeout_get.3 new file +15
-0@@ -0,0 +1,15 @@ +.TH "dmmp_context_timeout_get" 3 "dmmp_context_timeout_get" "March 2021" "Device Mapper Multipath API - libdmmp Manual" +.SH NAME +dmmp_context_timeout_get \- Get IPC timeout. +.SH SYNOPSIS +.B "unsigned int" dmmp_context_timeout_get +.BI "(struct dmmp_context *" ctx ");" +.SH ARGUMENTS +.IP "ctx" 12 +Pointer of 'struct dmmp_context'. +If this pointer is NULL, your program will be terminated by assert. +.SH "DESCRIPTION" + +Retrieve timeout value of IPC connection to multipathd daemon. +.SH "RETURN" +unsigned int. Timeout in milliseconds.libdmmp/docs/man/dmmp_context_timeout_set.3 new file +19
-0@@ -0,0 +1,19 @@ +.TH "dmmp_context_timeout_set" 3 "dmmp_context_timeout_set" "March 2021" "Device Mapper Multipath API - libdmmp Manual" +.SH NAME +dmmp_context_timeout_set \- Set IPC timeout. +.SH SYNOPSIS +.B "void" dmmp_context_timeout_set +.BI "(struct dmmp_context *" ctx "," +.BI "unsigned int " tmo ");" +.SH ARGUMENTS +.IP "ctx" 12 +Pointer of 'struct dmmp_context'. +If this pointer is NULL, your program will be terminated by assert. +.IP "tmo" 12 +Timeout in milliseconds(1 seconds equal 1000 milliseconds). +0 means infinite, function only return when error or pass. +.SH "DESCRIPTION" + +By default, the IPC to multipathd daemon will timeout after 60 seconds. +.SH "RETURN" +voidlibdmmp/docs/man/dmmp_context_userdata_get.3 new file +15
-0@@ -0,0 +1,15 @@ +.TH "dmmp_context_userdata_get" 3 "dmmp_context_userdata_get" "March 2021" "Device Mapper Multipath API - libdmmp Manual" +.SH NAME +dmmp_context_userdata_get \- Get user data pointer. +.SH SYNOPSIS +.B "void *" dmmp_context_userdata_get +.BI "(struct dmmp_context *" ctx ");" +.SH ARGUMENTS +.IP "ctx" 12 +Pointer of 'struct dmmp_context'. +If this pointer is NULL, your program will be terminated by assert. +.SH "DESCRIPTION" + +Retrieve user data pointer from 'struct dmmp_context'. +.SH "RETURN" +void *. Pointer of user defined data.libdmmp/docs/man/dmmp_context_userdata_set.3 new file +18
-0@@ -0,0 +1,18 @@ +.TH "dmmp_context_userdata_set" 3 "dmmp_context_userdata_set" "March 2021" "Device Mapper Multipath API - libdmmp Manual" +.SH NAME +dmmp_context_userdata_set \- Set user data pointer. +.SH SYNOPSIS +.B "void" dmmp_context_userdata_set +.BI "(struct dmmp_context *" ctx "," +.BI "void *" userdata ");" +.SH ARGUMENTS +.IP "ctx" 12 +Pointer of 'struct dmmp_context'. +If this pointer is NULL, your program will be terminated by assert. +.IP "userdata" 12 +Pointer of user defined data. +.SH "DESCRIPTION" + +Store user data pointer into 'struct dmmp_context'. +.SH "RETURN" +voidlibdmmp/docs/man/dmmp_flush_mpath.3 new file +36
-0@@ -0,0 +1,36 @@ +.TH "dmmp_flush_mpath" 3 "dmmp_flush_mpath" "March 2021" "Device Mapper Multipath API - libdmmp Manual" +.SH NAME +dmmp_flush_mpath \- Flush specified multipath device map if unused. +.SH SYNOPSIS +.B "int" dmmp_flush_mpath +.BI "(struct dmmp_context *" ctx "," +.BI "const char *" mpath_name ");" +.SH ARGUMENTS +.IP "ctx" 12 +Pointer of 'struct dmmp_context'. +If this pointer is NULL, your program will be terminated by assert. +.IP "mpath_name" 12 +const char *. The name of multipath device map. +.SH "DESCRIPTION" + +Flush a multipath device map specified as parameter, if unused. +.SH "RETURN" +int. Valid error codes are: + +* DMMP_OK + +* DMMP_ERR_BUG + +* DMMP_ERR_NO_MEMORY + +* DMMP_ERR_NO_DAEMON + +* DMMP_ERR_MPATH_BUSY + +* DMMP_ERR_MPATH_NOT_FOUND + +* DMMP_ERR_INVALID_ARGUMENT + +* DMMP_ERR_PERMISSION_DENY + +Error number could be converted to string by \fBdmmp_strerror\fP.libdmmp/docs/man/dmmp_last_error_msg.3 new file +16
-0@@ -0,0 +1,16 @@ +.TH "dmmp_last_error_msg" 3 "dmmp_last_error_msg" "March 2021" "Device Mapper Multipath API - libdmmp Manual" +.SH NAME +dmmp_last_error_msg \- Retrieves the last error message. +.SH SYNOPSIS +.B "const char *" dmmp_last_error_msg +.BI "(struct dmmp_context *" ctx ");" +.SH ARGUMENTS +.IP "ctx" 12 +Pointer of 'struct dmmp_context'. +If this pointer is NULL, your program will be terminated by assert. +.SH "DESCRIPTION" + +Retrieves the last error message. +.SH "RETURN" +const char *. No need to free this memory, the resources will get +freed when \fBdmmp_context_free\fP.libdmmp/docs/man/dmmp_log_priority_str.3 new file +24
-0@@ -0,0 +1,24 @@ +.TH "dmmp_log_priority_str" 3 "dmmp_log_priority_str" "March 2021" "Device Mapper Multipath API - libdmmp Manual" +.SH NAME +dmmp_log_priority_str \- Convert log priority to string. +.SH SYNOPSIS +.B "const char *" dmmp_log_priority_str +.BI "(int " priority ");" +.SH ARGUMENTS +.IP "priority" 12 +int. Log priority. +.SH "DESCRIPTION" + +Convert log priority to string (const char *). +.SH "RETURN" +const char *. Valid string are: + +* "ERROR" for DMMP_LOG_PRIORITY_ERROR + +* "WARN " for DMMP_LOG_PRIORITY_WARNING + +* "INFO " for DMMP_LOG_PRIORITY_INFO + +* "DEBUG" for DMMP_LOG_PRIORITY_DEBUG + +* "Invalid argument" for invalid log priority.libdmmp/docs/man/dmmp_mpath_array_free.3 new file +18
-0@@ -0,0 +1,18 @@ +.TH "dmmp_mpath_array_free" 3 "dmmp_mpath_array_free" "March 2021" "Device Mapper Multipath API - libdmmp Manual" +.SH NAME +dmmp_mpath_array_free \- Free 'struct dmmp_mpath' pointer array. +.SH SYNOPSIS +.B "void" dmmp_mpath_array_free +.BI "(struct dmmp_mpath **" dmmp_mps "," +.BI "uint32_t " dmmp_mp_count ");" +.SH ARGUMENTS +.IP "dmmp_mps" 12 +Pointer of 'struct dmmp_mpath' array. +.IP "dmmp_mp_count" 12 +uint32_t, the size of 'dmmp_mps' pointer array. +.SH "DESCRIPTION" + +Free the 'dmmp_mps' pointer array generated by \fBdmmp_mpath_array_get\fP. +If provided 'dmmp_mps' pointer is NULL or dmmp_mp_count == 0, do nothing. +.SH "RETURN" +voidlibdmmp/docs/man/dmmp_mpath_array_get.3 new file +36
-0@@ -0,0 +1,36 @@ +.TH "dmmp_mpath_array_get" 3 "dmmp_mpath_array_get" "March 2021" "Device Mapper Multipath API - libdmmp Manual" +.SH NAME +dmmp_mpath_array_get \- Query all existing multipath devices. +.SH SYNOPSIS +.B "int" dmmp_mpath_array_get +.BI "(struct dmmp_context *" ctx "," +.BI "struct dmmp_mpath ***" dmmp_mps "," +.BI "uint32_t *" dmmp_mp_count ");" +.SH ARGUMENTS +.IP "ctx" 12 +Pointer of 'struct dmmp_context'. +If this pointer is NULL, your program will be terminated by assert. +.IP "dmmp_mps" 12 +Output pointer array of 'struct dmmp_mpath'. +If this pointer is NULL, your program will be terminated by assert. +.IP "dmmp_mp_count" 12 +Output pointer of uint32_t. Hold the size of 'dmmp_mps' pointer array. +If this pointer is NULL, your program will be terminated by assert. +.SH "DESCRIPTION" + +Query all existing multipath devices and store them into a pointer array. +The memory of 'dmmp_mps' should be freed via \fBdmmp_mpath_array_free\fP. +.SH "RETURN" +int. Valid error codes are: + +* DMMP_OK + +* DMMP_ERR_BUG + +* DMMP_ERR_NO_MEMORY + +* DMMP_ERR_NO_DAEMON + +* DMMP_ERR_INCONSISTENT_DATA + +Error number could be converted to string by \fBdmmp_strerror\fP.libdmmp/docs/man/dmmp_mpath_kdev_name_get.3 new file +17
-0@@ -0,0 +1,17 @@ +.TH "dmmp_mpath_kdev_name_get" 3 "dmmp_mpath_kdev_name_get" "March 2021" "Device Mapper Multipath API - libdmmp Manual" +.SH NAME +dmmp_mpath_kdev_name_get \- Retrieve kernel DEVNAME of certain mpath. +.SH SYNOPSIS +.B "const char *" dmmp_mpath_kdev_name_get +.BI "(struct dmmp_mpath *" dmmp_mp ");" +.SH ARGUMENTS +.IP "dmmp_mp" 12 +Pointer of 'struct dmmp_mpath'. +If this pointer is NULL, your program will be terminated by assert. +.SH "DESCRIPTION" + +Retrieve DEVNAME name used by kernel uevent of specified mpath. +For example: 'dm-1'. +.SH "RETURN" +const char *. No need to free this memory, the resources will get +freed when \fBdmmp_mpath_array_free\fP.libdmmp/docs/man/dmmp_mpath_name_get.3 new file +18
-0@@ -0,0 +1,18 @@ +.TH "dmmp_mpath_name_get" 3 "dmmp_mpath_name_get" "March 2021" "Device Mapper Multipath API - libdmmp Manual" +.SH NAME +dmmp_mpath_name_get \- Retrieve name(alias) of certain mpath. +.SH SYNOPSIS +.B "const char *" dmmp_mpath_name_get +.BI "(struct dmmp_mpath *" dmmp_mp ");" +.SH ARGUMENTS +.IP "dmmp_mp" 12 +Pointer of 'struct dmmp_mpath'. +If this pointer is NULL, your program will be terminated by assert. +.SH "DESCRIPTION" + +Retrieve the name (also known as alias) of certain mpath. +When the config 'user_friendly_names' been set 'no', the name will be +identical to WWID retrieved by \fBdmmp_mpath_wwid_get\fP. +.SH "RETURN" +const char *. No need to free this memory, the resources will get +freed when \fBdmmp_mpath_array_free\fP.libdmmp/docs/man/dmmp_mpath_wwid_get.3 new file +13
-0@@ -0,0 +1,13 @@ +.TH "dmmp_mpath_wwid_get" 3 "dmmp_mpath_wwid_get" "March 2021" "Device Mapper Multipath API - libdmmp Manual" +.SH NAME +dmmp_mpath_wwid_get \- Retrieve WWID of certain mpath. +.SH SYNOPSIS +.B "const char *" dmmp_mpath_wwid_get +.BI "(struct dmmp_mpath *" dmmp_mp ");" +.SH ARGUMENTS +.IP "dmmp_mp" 12 +Pointer of 'struct dmmp_mpath'. +If this pointer is NULL, your program will be terminated by assert. +.SH "RETURN" +const char *. No need to free this memory, the resources will get +freed when \fBdmmp_mpath_array_free\fP.libdmmp/docs/man/dmmp_path_array_get.3 new file +25
-0@@ -0,0 +1,25 @@ +.TH "dmmp_path_array_get" 3 "dmmp_path_array_get" "March 2021" "Device Mapper Multipath API - libdmmp Manual" +.SH NAME +dmmp_path_array_get \- Retrieve path pointer array. +.SH SYNOPSIS +.B "void" dmmp_path_array_get +.BI "(struct dmmp_path_group *" dmmp_pg "," +.BI "struct dmmp_path ***" dmmp_ps "," +.BI "uint32_t *" dmmp_p_count ");" +.SH ARGUMENTS +.IP "dmmp_pg" 12 +Pointer of 'struct dmmp_path_group'. +If this pointer is NULL, your program will be terminated by assert. +.IP "dmmp_ps" 12 +Output pointer of 'struct dmmp_path' pointer array. +If this pointer is NULL, your program will be terminated by assert. +.IP "dmmp_p_count" 12 +Output pointer of uint32_t. Hold the size of 'dmmp_ps' pointer array. +If this pointer is NULL, your program will be terminated by assert. +.SH "DESCRIPTION" + +The memory of output pointer array is hold by 'struct dmmp_mpath', no +need to free this memory, the resources will got freed when +\fBdmmp_mpath_array_free\fP. +.SH "RETURN" +voidlibdmmp/docs/man/dmmp_path_blk_name_get.3 new file +17
-0@@ -0,0 +1,17 @@ +.TH "dmmp_path_blk_name_get" 3 "dmmp_path_blk_name_get" "March 2021" "Device Mapper Multipath API - libdmmp Manual" +.SH NAME +dmmp_path_blk_name_get \- Retrieve block name. +.SH SYNOPSIS +.B "const char *" dmmp_path_blk_name_get +.BI "(struct dmmp_path *" dmmp_p ");" +.SH ARGUMENTS +.IP "dmmp_p" 12 +Pointer of 'struct dmmp_path'. +If this pointer is NULL, your program will be terminated by assert. +.SH "DESCRIPTION" + +Retrieve block name of certain path. The example of block names are "sda", +"nvme0n1". +.SH "RETURN" +const char *. No need to free this memory, the resources will get +freed when \fBdmmp_mpath_array_free\fP.libdmmp/docs/man/dmmp_path_group_array_get.3 new file +27
-0@@ -0,0 +1,27 @@ +.TH "dmmp_path_group_array_get" 3 "dmmp_path_group_array_get" "March 2021" "Device Mapper Multipath API - libdmmp Manual" +.SH NAME +dmmp_path_group_array_get \- Retrieve path groups pointer array. +.SH SYNOPSIS +.B "void" dmmp_path_group_array_get +.BI "(struct dmmp_mpath *" dmmp_mp "," +.BI "struct dmmp_path_group ***" dmmp_pgs "," +.BI "uint32_t *" dmmp_pg_count ");" +.SH ARGUMENTS +.IP "dmmp_mp" 12 +Pointer of 'struct dmmp_mpath'. +If this pointer is NULL, your program will be terminated by assert. +.IP "dmmp_pgs" 12 +Output pointer of 'struct dmmp_path_group' pointer array. +If this pointer is NULL, your program will be terminated by assert. +.IP "dmmp_pg_count" 12 +Output pointer of uint32_t. Hold the size of 'dmmp_pgs' pointer array. +If this pointer is NULL, your program will be terminated by assert. +.SH "DESCRIPTION" + +Retrieve the path groups of certain mpath. + +The memory of output pointer array is hold by 'struct dmmp_mpath', no +need to free this memory, the resources will got freed when +\fBdmmp_mpath_array_free\fP. +.SH "RETURN" +voidlibdmmp/docs/man/dmmp_path_group_id_get.3 new file +18
-0@@ -0,0 +1,18 @@ +.TH "dmmp_path_group_id_get" 3 "dmmp_path_group_id_get" "March 2021" "Device Mapper Multipath API - libdmmp Manual" +.SH NAME +dmmp_path_group_id_get \- Retrieve path group ID. +.SH SYNOPSIS +.B "uint32_t" dmmp_path_group_id_get +.BI "(struct dmmp_path_group *" dmmp_pg ");" +.SH ARGUMENTS +.IP "dmmp_pg" 12 +Pointer of 'struct dmmp_path_group'. +If this pointer is NULL, your program will be terminated by assert. +.SH "DESCRIPTION" + +Retrieve the path group ID which could be used to switch active path group +via command: + +multipathd -k'switch multipath mpathb group $id' +.SH "RETURN" +uint32_t.libdmmp/docs/man/dmmp_path_group_priority_get.3 new file +16
-0@@ -0,0 +1,16 @@ +.TH "dmmp_path_group_priority_get" 3 "dmmp_path_group_priority_get" "March 2021" "Device Mapper Multipath API - libdmmp Manual" +.SH NAME +dmmp_path_group_priority_get \- Retrieve path group priority. +.SH SYNOPSIS +.B "uint32_t" dmmp_path_group_priority_get +.BI "(struct dmmp_path_group *" dmmp_pg ");" +.SH ARGUMENTS +.IP "dmmp_pg" 12 +Pointer of 'struct dmmp_path_group'. +If this pointer is NULL, your program will be terminated by assert. +.SH "DESCRIPTION" + +The enabled path group with highest priority will be next active path group +if active path group down. +.SH "RETURN" +uint32_t.libdmmp/docs/man/dmmp_path_group_selector_get.3 new file +16
-0@@ -0,0 +1,16 @@ +.TH "dmmp_path_group_selector_get" 3 "dmmp_path_group_selector_get" "March 2021" "Device Mapper Multipath API - libdmmp Manual" +.SH NAME +dmmp_path_group_selector_get \- Retrieve path group selector. +.SH SYNOPSIS +.B "const char *" dmmp_path_group_selector_get +.BI "(struct dmmp_path_group *" dmmp_pg ");" +.SH ARGUMENTS +.IP "dmmp_pg" 12 +Pointer of 'struct dmmp_path_group'. +If this pointer is NULL, your program will be terminated by assert. +.SH "DESCRIPTION" + +Path group selector determine which path in active path group will be +use to next I/O. +.SH "RETURN" +const char *.libdmmp/docs/man/dmmp_path_group_status_get.3 new file +23
-0@@ -0,0 +1,23 @@ +.TH "dmmp_path_group_status_get" 3 "dmmp_path_group_status_get" "March 2021" "Device Mapper Multipath API - libdmmp Manual" +.SH NAME +dmmp_path_group_status_get \- Retrieve path group status. +.SH SYNOPSIS +.B "uint32_t" dmmp_path_group_status_get +.BI "(struct dmmp_path_group *" dmmp_pg ");" +.SH ARGUMENTS +.IP "dmmp_pg" 12 +Pointer of 'struct dmmp_path_group'. +If this pointer is NULL, your program will be terminated by assert. +.SH "DESCRIPTION" + +The valid path group statuses are: + +* DMMP_PATH_GROUP_STATUS_UNKNOWN + +* DMMP_PATH_GROUP_STATUS_ENABLED -- standby to be active + +* DMMP_PATH_GROUP_STATUS_DISABLED -- disabled due to all path down + +* DMMP_PATH_GROUP_STATUS_ACTIVE -- selected to handle I/O +.SH "RETURN" +uint32_t.libdmmp/docs/man/dmmp_path_group_status_str.3 new file +26
-0@@ -0,0 +1,26 @@ +.TH "dmmp_path_group_status_str" 3 "dmmp_path_group_status_str" "March 2021" "Device Mapper Multipath API - libdmmp Manual" +.SH NAME +dmmp_path_group_status_str \- Convert path group status to string. +.SH SYNOPSIS +.B "const char *" dmmp_path_group_status_str +.BI "(uint32_t " pg_status ");" +.SH ARGUMENTS +.IP "pg_status" 12 +uint32_t. Path group status. +When provided value is not a valid path group status, return "Invalid +argument". +.SH "DESCRIPTION" + +Convert path group status uint32_t to string (const char *). +.SH "RETURN" +const char *. Valid string are: + +* "Invalid argument" + +* "undef" + +* "enabled" + +* "disabled" + +* "active"libdmmp/docs/man/dmmp_path_status_get.3 new file +54
-0@@ -0,0 +1,54 @@ +.TH "dmmp_path_status_get" 3 "dmmp_path_status_get" "March 2021" "Device Mapper Multipath API - libdmmp Manual" +.SH NAME +dmmp_path_status_get \- Retrieve the path status. +.SH SYNOPSIS +.B "uint32_t" dmmp_path_status_get +.BI "(struct dmmp_path *" dmmp_p ");" +.SH ARGUMENTS +.IP "dmmp_p" 12 +Pointer of 'struct dmmp_path'. +If this pointer is NULL, your program will be terminated by assert. +.SH "DESCRIPTION" + +The valid path statuses are: + +* DMMP_PATH_STATUS_UNKNOWN + +* DMMP_PATH_STATUS_DOWN + +Path is down and you shouldn't try to send commands to it. + +* DMMP_PATH_STATUS_UP + +Path is up and I/O can be sent to it. + +* DMMP_PATH_STATUS_SHAKY + +Only emc_clariion checker when path not available for "normal" +operations. + +* DMMP_PATH_STATUS_GHOST + +Only hp_sw and rdac checkers. Indicates a "passive/standby" +path on active/passive HP arrays. These paths will return valid +answers to certain SCSI commands (tur, read_capacity, inquiry, +start_stop), but will fail I/O commands. The path needs an +initialization command to be sent to it in order for I/Os to +succeed. + +* DMMP_PATH_STATUS_PENDING + +Available for all async checkers when a check IO is in flight. + +* DMMP_PATH_STATUS_TIMEOUT + +Only tur checker when command timed out. + +* DMMP_PATH_STATUS_DELAYED + +If a path fails after being up for less than delay_watch_checks checks, +when it comes back up again, it will not be marked as up until it has +been up for delay_wait_checks checks. During this time, it is marked as +"delayed". +.SH "RETURN" +uint32_t.libdmmp/docs/man/dmmp_path_status_str.3 new file +34
-0@@ -0,0 +1,34 @@ +.TH "dmmp_path_status_str" 3 "dmmp_path_status_str" "March 2021" "Device Mapper Multipath API - libdmmp Manual" +.SH NAME +dmmp_path_status_str \- Convert path status to string. +.SH SYNOPSIS +.B "const char *" dmmp_path_status_str +.BI "(uint32_t " path_status ");" +.SH ARGUMENTS +.IP "path_status" 12 +uint32_t. Path status. +When provided value is not a valid path status, return +"Invalid argument". +.SH "DESCRIPTION" + +Convert path status uint32_t to string (const char *): + +* DMMP_PATH_STATUS_UNKNOWN -- "undef" + +* DMMP_PATH_STATUS_DOWN -- "faulty" + +* DMMP_PATH_STATUS_UP -- "ready" + +* DMMP_PATH_STATUS_SHAKY -- "shaky" + +* DMMP_PATH_STATUS_GHOST -- "ghost" + +* DMMP_PATH_STATUS_PENDING -- "pending" + +* DMMP_PATH_STATUS_TIMEOUT -- "timeout" + +* DMMP_PATH_STATUS_REMOVED -- "removed" + +* DMMP_PATH_STATUS_DELAYED -- "delayed" +.SH "RETURN" +const char *. The meaning of status value.libdmmp/docs/man/dmmp_reconfig.3 new file +27
-0@@ -0,0 +1,27 @@ +.TH "dmmp_reconfig" 3 "dmmp_reconfig" "March 2021" "Device Mapper Multipath API - libdmmp Manual" +.SH NAME +dmmp_reconfig \- Instruct multipathd daemon to do reconfiguration. +.SH SYNOPSIS +.B "int" dmmp_reconfig +.BI "(struct dmmp_context *" ctx ");" +.SH ARGUMENTS +.IP "ctx" 12 +Pointer of 'struct dmmp_context'. +If this pointer is NULL, your program will be terminated by assert. +.SH "DESCRIPTION" + +Instruct multipathd daemon to do reconfiguration. +.SH "RETURN" +int. Valid error codes are: + +* DMMP_OK + +* DMMP_ERR_BUG + +* DMMP_ERR_NO_MEMORY + +* DMMP_ERR_NO_DAEMON + +* DMMP_ERR_PERMISSION_DENY + +Error number could be converted to string by \fBdmmp_strerror\fP.libdmmp/docs/man/dmmp_strerror.3 new file +33
-0@@ -0,0 +1,33 @@ +.TH "dmmp_strerror" 3 "dmmp_strerror" "March 2021" "Device Mapper Multipath API - libdmmp Manual" +.SH NAME +dmmp_strerror \- Convert error code to string. +.SH SYNOPSIS +.B "const char *" dmmp_strerror +.BI "(int " rc ");" +.SH ARGUMENTS +.IP "rc" 12 +int. Return code by libdmmp functions. When provided error code is not a +valid error code, return "Invalid argument". +.SH "DESCRIPTION" + +Convert error code (int) to string (const char *): + +* DMMP_OK -- "OK" + +* DMMP_ERR_BUG -- "BUG of libdmmp library" + +* DMMP_ERR_NO_MEMORY -- "Out of memory" + +* DMMP_ERR_IPC_TIMEOUT -- "Timeout when communicate with multipathd, +try to set bigger timeout value via dmmp_context_timeout_set ()" + +* DMMP_ERR_IPC_ERROR -- "Error when communicate with multipathd daemon" + +* DMMP_ERR_NO_DAEMON -- "The multipathd daemon not started" + +* DMMP_ERR_INCOMPATIBLE -- "The multipathd daemon version is not +compatible with current library" + +* Other invalid error number -- "Invalid argument" +.SH "RETURN" +const char *. The meaning of provided error code.libdmmp/docs/man/libdmmp.h.3 renamed from libdmmp/docs/libdmmp.h.3 +0
-0Signature · 1 line
2.30.1
--
dm-devel mailing list
[email protected]
https://listman.redhat.com/mailman/listinfo/dm-devel
Quoted 3 lines · On Fri, Mar 26, 2021 at 10:29:37PM +0100, [email protected] wrote:
From: Martin Wilck <[email protected]>
Hi Christophe, hi Ben,
For the set
Quoted 96 lines
I've spent most of this week trying to improve the multipath-tools CI workflows on github. I now have CI workflows for 7 different distributions covering ~6 years of development, and 5 different architectures, running routinely on Github. While I found only one minor bug in multipath-tools in this process, I hope this will help avoiding regressions on less frequently-tested distributions in the future. Please read the commit message of the patch "github workflows:
add containerized / multi-arch tests" for the details.You can see this in action on https://github.com/openSUSE/multipath-tools/actions.
The patch set is included in the "tip" branch.What we need now is more unit tests; our code coverage is still pretty pathetic.
LOC-wise, the bulk of this patch set are libdmmp man pages. These are almost 100% static. Including them in git allows us to get rid of perl as a build-time requirement, which will allow me (in the future) to reduce the size of the build container images significantly.
Regards
MartinMartin Wilck (7):
multipath-tools Makefiles: make pkg-config configurable multipath-tools Makefiles: allow building test programs only github workflows: add containerized / multi-arch tests
libdmmp: allow building without perl
multipath-toolsMakefile: build before install
fixup "multipath-tools tests: check if/sys/dev/blockis non-empty"
libmultipath: fix warning with clang 3.5.github/workflows/build-and-unittest.yaml | 4 +- .github/workflows/foreign.yaml | 65 +++++++++++++++++++ .github/workflows/native.yaml | 31 +++++++++ Makefile | 9 ++- Makefile.inc | 6 +- libdmmp/Makefile | 41 +++++------- libdmmp/docs/man/dmmp_context_free.3 | 15 +++++ libdmmp/docs/man/dmmp_context_log_func_set.3 | 21 ++++++ .../docs/man/dmmp_context_log_priority_get.3 | 23 +++++++ .../docs/man/dmmp_context_log_priority_set.3 | 29 +++++++++ libdmmp/docs/man/dmmp_context_new.3 | 19 ++++++ libdmmp/docs/man/dmmp_context_timeout_get.3 | 15 +++++ libdmmp/docs/man/dmmp_context_timeout_set.3 | 19 ++++++ libdmmp/docs/man/dmmp_context_userdata_get.3 | 15 +++++ libdmmp/docs/man/dmmp_context_userdata_set.3 | 18 +++++ libdmmp/docs/man/dmmp_flush_mpath.3 | 36 ++++++++++ libdmmp/docs/man/dmmp_last_error_msg.3 | 16 +++++ libdmmp/docs/man/dmmp_log_priority_str.3 | 24 +++++++ libdmmp/docs/man/dmmp_mpath_array_free.3 | 18 +++++ libdmmp/docs/man/dmmp_mpath_array_get.3 | 36 ++++++++++ libdmmp/docs/man/dmmp_mpath_kdev_name_get.3 | 17 +++++ libdmmp/docs/man/dmmp_mpath_name_get.3 | 18 +++++ libdmmp/docs/man/dmmp_mpath_wwid_get.3 | 13 ++++ libdmmp/docs/man/dmmp_path_array_get.3 | 25 +++++++ libdmmp/docs/man/dmmp_path_blk_name_get.3 | 17 +++++ libdmmp/docs/man/dmmp_path_group_array_get.3 | 27 ++++++++ libdmmp/docs/man/dmmp_path_group_id_get.3 | 18 +++++ .../docs/man/dmmp_path_group_priority_get.3 | 16 +++++ .../docs/man/dmmp_path_group_selector_get.3 | 16 +++++ libdmmp/docs/man/dmmp_path_group_status_get.3 | 23 +++++++ libdmmp/docs/man/dmmp_path_group_status_str.3 | 26 ++++++++ libdmmp/docs/man/dmmp_path_status_get.3 | 54 +++++++++++++++ libdmmp/docs/man/dmmp_path_status_str.3 | 34 ++++++++++ libdmmp/docs/man/dmmp_reconfig.3 | 27 ++++++++ libdmmp/docs/man/dmmp_strerror.3 | 33 ++++++++++ libdmmp/docs/{ => man}/libdmmp.h.3 | 0 libmultipath/io_err_stat.c | 2 +- tests/Makefile | 1 + tests/devt.c | 2 +- 39 files changed, 797 insertions(+), 32 deletions(-) create mode 100644 .github/workflows/foreign.yaml create mode 100644 .github/workflows/native.yaml create mode 100644 libdmmp/docs/man/dmmp_context_free.3 create mode 100644 libdmmp/docs/man/dmmp_context_log_func_set.3 create mode 100644 libdmmp/docs/man/dmmp_context_log_priority_get.3 create mode 100644 libdmmp/docs/man/dmmp_context_log_priority_set.3 create mode 100644 libdmmp/docs/man/dmmp_context_new.3 create mode 100644 libdmmp/docs/man/dmmp_context_timeout_get.3 create mode 100644 libdmmp/docs/man/dmmp_context_timeout_set.3 create mode 100644 libdmmp/docs/man/dmmp_context_userdata_get.3 create mode 100644 libdmmp/docs/man/dmmp_context_userdata_set.3 create mode 100644 libdmmp/docs/man/dmmp_flush_mpath.3 create mode 100644 libdmmp/docs/man/dmmp_last_error_msg.3 create mode 100644 libdmmp/docs/man/dmmp_log_priority_str.3 create mode 100644 libdmmp/docs/man/dmmp_mpath_array_free.3 create mode 100644 libdmmp/docs/man/dmmp_mpath_array_get.3 create mode 100644 libdmmp/docs/man/dmmp_mpath_kdev_name_get.3 create mode 100644 libdmmp/docs/man/dmmp_mpath_name_get.3 create mode 100644 libdmmp/docs/man/dmmp_mpath_wwid_get.3 create mode 100644 libdmmp/docs/man/dmmp_path_array_get.3 create mode 100644 libdmmp/docs/man/dmmp_path_blk_name_get.3 create mode 100644 libdmmp/docs/man/dmmp_path_group_array_get.3 create mode 100644 libdmmp/docs/man/dmmp_path_group_id_get.3 create mode 100644 libdmmp/docs/man/dmmp_path_group_priority_get.3
Quoted 11 lines
create mode 100644 libdmmp/docs/man/dmmp_path_group_selector_get.3 create mode 100644 libdmmp/docs/man/dmmp_path_group_status_get.3 create mode 100644 libdmmp/docs/man/dmmp_path_group_status_str.3 create mode 100644 libdmmp/docs/man/dmmp_path_status_get.3 create mode 100644 libdmmp/docs/man/dmmp_path_status_str.3 create mode 100644 libdmmp/docs/man/dmmp_reconfig.3 create mode 100644 libdmmp/docs/man/dmmp_strerror.3 rename libdmmp/docs/{ => man}/libdmmp.h.3 (100%)Signature · 1 line
2.30.1
--
dm-devel mailing list
[email protected]
https://listman.redhat.com/mailman/listinfo/dm-devel
Re: [dm-devel] [PATCH 4/7] libdmmp: allow building without perl
In reply to Benjamin MarzinskiQuoted 7 lines · Benjamin Marzinski
Quoted 6 lines · On Fri, Mar 26, 2021 at 10:29:41PM +0100, [email protected] wrote:
From: Martin Wilck <[email protected]>
Add the kernel-doc generated manpages of libdmmp to git, and change the libdmmp
Makefileto regenerate them (only) when necessary.
Quoted 5 lines
Quoted 1 line
This allows us to drop perl as a build-time requirement.
Git complains about a bunch of trailing whitespace issues here, but this
is a great idea.
The files are generated by kernel-doc. So unless we want to work on the whitespace treatment of kernel-doc (I wouldn't), we have to live with git's complaints in this area.
Thanks,
Martin
--
dm-devel mailing list
[email protected]
https://listman.redhat.com/mailman/listinfo/dm-devel
Re: [dm-devel] [PATCH 3/7] github workflows: add containerized / multi-arch tests
In reply to Benjamin MarzinskiQuoted 14 lines · Benjamin Marzinski
.github/workflows/build-and-unittest.yaml line 4
Quoted 12 lines · On Fri, Mar 26, 2021 at 10:29:40PM +0100, [email protected] wrote:
.github/workflows/build-and-unittest.yaml +0
-0@@ -1,5 +1,7 @@name: basic-build-and-ci
.github/workflows/build-and-unittest.yaml +3
-1-on: [push] +on: + push: + branches: [master queue tip]
This is broken (commas missing, I'm still not fluent in YAML). I'll fix this in github without re-posting.
Martin
--
dm-devel mailing list
[email protected]
https://listman.redhat.com/mailman/listinfo/dm-devel
Re: [dm-devel] [PATCH 3/7] github workflows: add containerized / multi-arch tests
In reply to Benjamin MarzinskiQuoted 6 lines · Benjamin Marzinski
Quoted 4 lines · On Fri, Mar 26, 2021 at 10:29:40PM +0100, [email protected] wrote:
Tell me if you want this in the multipath-tools repo, and if you're ok
with hosting the images in my docker hub repo.
Quoted 8 lines
I don't have problems with this setup. I haven't really looked into github actions, and so really don't know how easy it setup rules to run actions on events other that pushes, pull requests, etc. It seems reasonable to store those in a seperate repository. It would probably be
good to have Christophe weigh in as well before adding these. Although I
suppose it's always possible to disable these actions in other repos.
The events and branches are specified in the job file (YAML file). When an event occurs on a github repository, github looks at the associated commit (SHA), and considers the workflows _included in the tree for this commit_. AFAIU, for "push" events, this means that if a branch B is pushed with tip commit C, only workflows that exist in C _and_ reference branch B will be run.
(see https://docs.github.com/en/actions/reference/events-that-trigger-workflows)
@Christophe, you will need to consider how he would like to set this up in your repo. Different repos may have different policies, and it's possible that you'll have to tweak or amend when you merge pull requests from myself or other people that include changes to github actions. For example, you may want to run CI on a different selection of branches. I currently have little need for CI runs on pull requests, but for you, that may be exactly what you need. Thinking about it, I'll add pull-request triggers.
In general, I will separate github related changes from other code changes, as discussed before. The reason I didn't in this patch set was that I wanted to advertise my github-action-related work ;-)
Cheers,
Martin
--
dm-devel mailing list
[email protected]
https://listman.redhat.com/mailman/listinfo/dm-devel
Benjamin Marzinski
maintainerRe: [dm-devel] [PATCH 4/7] libdmmp: allow building without perl
In reply to Martin WilckQuoted 10 lines · Martin Wilck
Quoted 9 lines · Benjamin Marzinski
Quoted 7 lines · On Fri, Mar 26, 2021 at 10:29:41PM +0100, [email protected] wrote:
From: Martin Wilck <[email protected]>
Add the kernel-doc generated manpages of libdmmp to git, and change the libdmmp
Makefileto regenerate them (only) when necessary.This allows us to drop perl as a build-time requirement.
Quoted 7 lines
Quoted 3 lines
Git complains about a bunch of trailing whitespace issues here, but this
is a great idea.The files are generated by kernel-doc. So unless we want to work on the whitespace treatment of kernel-doc (I wouldn't), we have to live with git's complaints in this area.
Yeah. I figured that fixing this wouldn't be easy, that's why I ACK'ed the whole set.
-Ben
Quoted 4 lines
Thanks,
Martin
--
dm-devel mailing list
[email protected]
https://listman.redhat.com/mailman/listinfo/dm-devel
Benjamin Marzinski
maintainerRe: [dm-devel] [PATCH 3/7] github workflows: add containerized / multi-arch tests
In reply to Martin WilckQuoted 24 lines · Martin Wilck
Quoted 6 lines · Benjamin Marzinski
Quoted 4 lines · On Fri, Mar 26, 2021 at 10:29:40PM +0100, [email protected] wrote:
Tell me if you want this in the multipath-tools repo, and if you're ok
with hosting the images in my docker hub repo.Quoted 8 lines
I don't have problems with this setup. I haven't really looked into github actions, and so really don't know how easy it setup rules to run actions on events other that pushes, pull requests, etc. It seems reasonable to store those in a seperate repository. It would probably be
good to have Christophe weigh in as well before adding these. Although I
suppose it's always possible to disable these actions in other repos.The events and branches are specified in the job file (YAML file). When an event occurs on a github repository, github looks at the associated commit (SHA), and considers the workflows
_includedin the tree for thiscommit_. AFAIU, for "push" events, this means that if a branch B is pushed with tip commit C, only workflows that exist in C _and_ reference branch B will be run.
(see https://docs.github.com/en/actions/reference/events-that-trigger-workflows)
Quoted 8 lines
@Christophe, you will need to consider how he would like to set this up in your repo. Different repos may have different policies, and it's possible that you'll have to tweak or amend when you merge pull requests from myself or other people that include changes to github actions. For example, you may want to run CI on a different selection of branches. I currently have little need for CI runs on pull requests, but for you, that may be exactly what you need. Thinking about it, I'll add pull-request triggers.
I believe that you can make github check and only run actions on specific repositories, so Christophe could have different policies, while still using the same yaml file.
-Ben
Quoted 19 lines
In general, I will separate github related changes from other code changes, as discussed before. The reason I didn't in this patch set was that I wanted to advertise my github-action-related work ;-)
Cheers,
Martin
--
dm-devel mailing list
[email protected]
https://listman.redhat.com/mailman/listinfo/dm-devel
Re: [dm-devel] [PATCH 4/7] libdmmp: allow building without perl
In reply to [email protected]Quoted 3 lines · On 3/26/21 10:29 PM, [email protected] wrote:
Add the kernel-doc generated manpages of libdmmp to git, and change the libdmmp
Makefileto regenerate them (only) when necessary.
Every month, nice try :-)
$ git diff
libdmmp/docs/man/dmmp_context_free.3 +1 -1
@@ -1,4 +1,4 @@ -.TH "dmmp_context_free" 3 "dmmp_context_free" "March 2021" "Device Mapper Multipath API - libdmmp Manual" +.TH "dmmp_context_free" 3 "dmmp_context_free" "May 2021" "Device Mapper Multipath API - libdmmp Manual" .SH NAME dmmp_context_free \- Release the memory of struct dmmp_context. .SH SYNOPSIS
[...]
$ git status On branch queue Your branch is up to date with 'origin/queue'.
Changes not staged for commit:
(use "git add <file>..." to update what will be committed) (use "git restore <file>..." to discard changes in working directory)
modified: libdmmp/docs/man/dmmp_context_free.3
[...]
--
dm-devel mailing list
[email protected]
https://listman.redhat.com/mailman/listinfo/dm-devel
Re: [dm-devel] [PATCH 4/7] libdmmp: allow building without perl
Quoted 7 lines · Xose Vazquez Perez
Quoted 3 lines · On 3/26/21 10:29 PM, [email protected] wrote:
Add the kernel-doc generated manpages of libdmmp to git, and change the libdmmp
Makefileto regenerate them (only) when necessary.Every month, nice try :-)
Hm, doesn't happen here. What are you doing differently?
$ make -C libdmmp docs/man/dmmp_strerror.3 make: Entering directory '/mnt/git/mpath-tools/libdmmp' make: 'docs/man/dmmp_strerror.3' is up to date. make: Leaving directory '/mnt/git/mpath-tools/libdmmp'
Likewise, "make install" won't rebuild any man pages.
Regards,
Martin
Quoted 21 lines
$ git difflibdmmp/docs/man/dmmp_context_free.3 +0
-1@@ -1,4 +1,4 @@ -.TH "dmmp_context_free" 3 "dmmp_context_free" "March 2021" "DeviceMapper Multipath API - libdmmp Manual"
+.TH "dmmp_context_free" 3 "dmmp_context_free" "May 2021" "Device Mapper Multipath API - libdmmp Manual"
.SH NAME
dmmp_context_free\- Release the memory of structdmmp_context. .SH SYNOPSIS
[...]$ git status On branch queue Your branch is up to date with 'origin/queue'.
Quoted 7 lines
Changes not staged for commit:
(use "git add <file>..." to update what will be committed) (use "git restore <file>..." to discard changes in working directory)
modified: libdmmp/docs/man/dmmp_context_free.3 [...]
--
dm-devel mailing list
[email protected]
https://listman.redhat.com/mailman/listinfo/dm-devel
Re: [dm-devel] [PATCH 4/7] libdmmp: allow building without perl
Quoted 9 lines · Martin Wilck
Quoted 7 lines · Xose Vazquez Perez
Quoted 3 lines · On 3/26/21 10:29 PM, [email protected] wrote:
Add the kernel-doc generated manpages of libdmmp to git, and change the libdmmp
Makefileto regenerate them (only) when necessary.Every month, nice try :-)
Quoted 8 lines
Hm, doesn't happen here. What are you doing differently?
$ make -C libdmmp docs/man/dmmp_strerror.3 make: Entering directory '/mnt/git/mpath-tools/libdmmp' make: 'docs/man/dmmp_strerror.3' is up to date. make: Leaving directory '/mnt/git/mpath-tools/libdmmp'Likewise, "make install" won't rebuild any man pages.
Just:
$ git clone -b queue https://github.com/openSUSE/multipath-tools $ make $ git diff
--
dm-devel mailing list
[email protected]
https://listman.redhat.com/mailman/listinfo/dm-devel
Re: [dm-devel] [PATCH 4/7] libdmmp: allow building without perl
Quoted 18 lines · Xose Vazquez Perez
Quoted 16 lines · Martin Wilck
Quoted 7 lines · Xose Vazquez Perez
Quoted 3 lines · On 3/26/21 10:29 PM, [email protected] wrote:
Add the kernel-doc generated manpages of libdmmp to git, and change the libdmmp
Makefileto regenerate them (only) when necessary.Every month, nice try :-)
Hm, doesn't happen here. What are you doing differently?
$ make -C libdmmp docs/man/dmmp_strerror.3 make: Entering directory '/mnt/git/mpath-tools/libdmmp' make: 'docs/man/dmmp_strerror.3' is up to date. make: Leaving directory '/mnt/git/mpath-tools/libdmmp'
Quoted 7 lines
Quoted 1 line
Likewise, "make install" won't rebuild any man pages.
Just:
$ git clone -b queue https://github.com/openSUSE/multipath-tools $ make $ git diff
Ok, you create new clones all the time. Why don't you just fetch? Anyway, I'll post a patch that should fix this.
Martin
--
dm-devel mailing list
[email protected]
https://listman.redhat.com/mailman/listinfo/dm-devel
Re: [dm-devel] [PATCH 4/7] libdmmp: allow building without perl
Quoted 21 lines · Martin Wilck
Quoted 20 lines · Xose Vazquez Perez
Quoted 17 lines · Martin Wilck
Quoted 7 lines · Xose Vazquez Perez
Quoted 3 lines · On 3/26/21 10:29 PM, [email protected] wrote:
Add the kernel-doc generated manpages of libdmmp to git, and change the libdmmp
Makefileto regenerate them (only) when necessary.Every month, nice try :-)
Hm, doesn't happen here. What are you doing differently?
$ make -C libdmmp docs/man/dmmp_strerror.3 make: Entering directory '/mnt/git/mpath-tools/libdmmp' make: 'docs/man/dmmp_strerror.3' is up to date. make: Leaving directory '/mnt/git/mpath-tools/libdmmp'Likewise, "make install" won't rebuild any man pages.
Quoted 8 lines
Quoted 5 lines
Just:
$ git clone -b queue https://github.com/openSUSE/multipath-tools $ make $ git diffOk, you create new clones all the time. Why don't you just fetch? Anyway, I'll post a patch that should fix this.
It should work now if you clone the "tip" branch. Please test.
Martin
--
dm-devel mailing list
[email protected]
https://listman.redhat.com/mailman/listinfo/dm-devel