All of lore.kernel.org
 help / color / mirror / Atom feed
* [dm-devel] [PATCH 0/7] multipath-tools: extended github CI
@ 2021-03-26 21:29 mwilck
  2021-03-26 21:29 ` [dm-devel] [PATCH 1/7] multipath-tools Makefiles: make pkg-config configurable mwilck
                   ` (7 more replies)
  0 siblings, 8 replies; 23+ messages in thread
From: mwilck @ 2021-03-26 21:29 UTC (permalink / raw)
  To: Christophe Varoqui, Benjamin Marzinski
  Cc: dm-devel, Xose Vazquez Perez, Martin Wilck

From: Martin Wilck <mwilck@suse.com>

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%)

-- 
2.30.1


--
dm-devel mailing list
dm-devel@redhat.com
https://listman.redhat.com/mailman/listinfo/dm-devel


^ permalink raw reply	[flat|nested] 23+ messages in thread

* [dm-devel] [PATCH 1/7] multipath-tools Makefiles: make pkg-config configurable
  2021-03-26 21:29 [dm-devel] [PATCH 0/7] multipath-tools: extended github CI mwilck
@ 2021-03-26 21:29 ` mwilck
  2021-03-29 15:44   ` Xose Vazquez Perez
  2021-03-26 21:29 ` [dm-devel] [PATCH 2/7] multipath-tools Makefiles: allow building test programs only mwilck
                   ` (6 subsequent siblings)
  7 siblings, 1 reply; 23+ messages in thread
From: mwilck @ 2021-03-26 21:29 UTC (permalink / raw)
  To: Christophe Varoqui, Benjamin Marzinski
  Cc: dm-devel, Xose Vazquez Perez, Martin Wilck

From: Martin Wilck <mwilck@suse.com>

This is useful for building in a cross-compilation environment.

Signed-off-by: Martin Wilck <mwilck@suse.com>
---
 Makefile.inc     | 6 ++++--
 libdmmp/Makefile | 4 ++--
 2 files changed, 6 insertions(+), 4 deletions(-)

diff --git a/Makefile.inc b/Makefile.inc
index 0542930..f1e2313 100644
--- a/Makefile.inc
+++ b/Makefile.inc
@@ -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 | \
diff --git a/libdmmp/Makefile b/libdmmp/Makefile
index 1dd3f34..4175c3f 100644
--- a/libdmmp/Makefile
+++ b/libdmmp/Makefile
@@ -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
 
-- 
2.30.1


--
dm-devel mailing list
dm-devel@redhat.com
https://listman.redhat.com/mailman/listinfo/dm-devel


^ permalink raw reply related	[flat|nested] 23+ messages in thread

* [dm-devel] [PATCH 2/7] multipath-tools Makefiles: allow building test programs only
  2021-03-26 21:29 [dm-devel] [PATCH 0/7] multipath-tools: extended github CI mwilck
  2021-03-26 21:29 ` [dm-devel] [PATCH 1/7] multipath-tools Makefiles: make pkg-config configurable mwilck
@ 2021-03-26 21:29 ` mwilck
  2021-03-26 21:29 ` [dm-devel] [PATCH 3/7] github workflows: add containerized / multi-arch tests mwilck
                   ` (5 subsequent siblings)
  7 siblings, 0 replies; 23+ messages in thread
From: mwilck @ 2021-03-26 21:29 UTC (permalink / raw)
  To: Christophe Varoqui, Benjamin Marzinski
  Cc: dm-devel, Xose Vazquez Perez, Martin Wilck

From: Martin Wilck <mwilck@suse.com>

"make test" builds and runs test programs. For multiarch / cross-compilation
environments, it's useful to be able to separate these steps.

Signed-off-by: Martin Wilck <mwilck@suse.com>
---
 Makefile       | 7 +++++--
 tests/Makefile | 1 +
 2 files changed, 6 insertions(+), 2 deletions(-)

diff --git a/Makefile b/Makefile
index bddb2bf..c5bedcf 100644
--- a/Makefile
+++ b/Makefile
@@ -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
diff --git a/tests/Makefile b/tests/Makefile
index 11ca1be..e70c8ed 100644
--- a/tests/Makefile
+++ b/tests/Makefile
@@ -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
-- 
2.30.1


--
dm-devel mailing list
dm-devel@redhat.com
https://listman.redhat.com/mailman/listinfo/dm-devel


^ permalink raw reply related	[flat|nested] 23+ messages in thread

* [dm-devel] [PATCH 3/7] github workflows: add containerized / multi-arch tests
  2021-03-26 21:29 [dm-devel] [PATCH 0/7] multipath-tools: extended github CI mwilck
  2021-03-26 21:29 ` [dm-devel] [PATCH 1/7] multipath-tools Makefiles: make pkg-config configurable mwilck
  2021-03-26 21:29 ` [dm-devel] [PATCH 2/7] multipath-tools Makefiles: allow building test programs only mwilck
@ 2021-03-26 21:29 ` mwilck
  2021-03-30  3:23   ` Benjamin Marzinski
  2021-03-26 21:29 ` [dm-devel] [PATCH 4/7] libdmmp: allow building without perl mwilck
                   ` (4 subsequent siblings)
  7 siblings, 1 reply; 23+ messages in thread
From: mwilck @ 2021-03-26 21:29 UTC (permalink / raw)
  To: Christophe Varoqui, Benjamin Marzinski
  Cc: dm-devel, Xose Vazquez Perez, Martin Wilck

From: Martin Wilck <mwilck@suse.com>

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.

Signed-off-by: Martin Wilck <mwilck@suse.com>
---
 .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

diff --git a/.github/workflows/build-and-unittest.yaml b/.github/workflows/build-and-unittest.yaml
index 4173576..bf37b13 100644
--- a/.github/workflows/build-and-unittest.yaml
+++ b/.github/workflows/build-and-unittest.yaml
@@ -1,5 +1,7 @@
 name: basic-build-and-ci
-on:   [push]
+on:
+  push:
+    branches: [master queue tip]
 jobs:
   bionic:
     runs-on: ubuntu-18.04
diff --git a/.github/workflows/foreign.yaml b/.github/workflows/foreign.yaml
new file mode 100644
index 0000000..505a777
--- /dev/null
+++ b/.github/workflows/foreign.yaml
@@ -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
diff --git a/.github/workflows/native.yaml b/.github/workflows/native.yaml
new file mode 100644
index 0000000..abd39a0
--- /dev/null
+++ b/.github/workflows/native.yaml
@@ -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
+
-- 
2.30.1


--
dm-devel mailing list
dm-devel@redhat.com
https://listman.redhat.com/mailman/listinfo/dm-devel


^ permalink raw reply related	[flat|nested] 23+ messages in thread

* [dm-devel] [PATCH 4/7] libdmmp: allow building without perl
  2021-03-26 21:29 [dm-devel] [PATCH 0/7] multipath-tools: extended github CI mwilck
                   ` (2 preceding siblings ...)
  2021-03-26 21:29 ` [dm-devel] [PATCH 3/7] github workflows: add containerized / multi-arch tests mwilck
@ 2021-03-26 21:29 ` mwilck
  2021-03-30  4:25   ` Benjamin Marzinski
  2021-05-17 19:47   ` Xose Vazquez Perez
  2021-03-26 21:29 ` [dm-devel] [PATCH 5/7] multipath-tools Makefile: build before install mwilck
                   ` (3 subsequent siblings)
  7 siblings, 2 replies; 23+ messages in thread
From: mwilck @ 2021-03-26 21:29 UTC (permalink / raw)
  To: Christophe Varoqui, Benjamin Marzinski
  Cc: dm-devel, Xose Vazquez Perez, Martin Wilck

From: Martin Wilck <mwilck@suse.com>

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.

Signed-off-by: Martin Wilck <mwilck@suse.com>
---
 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%)

diff --git a/libdmmp/Makefile b/libdmmp/Makefile
index 4175c3f..764a0bc 100644
--- a/libdmmp/Makefile
+++ b/libdmmp/Makefile
@@ -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)
diff --git a/libdmmp/docs/man/dmmp_context_free.3 b/libdmmp/docs/man/dmmp_context_free.3
new file mode 100644
index 0000000..0d26f42
--- /dev/null
+++ b/libdmmp/docs/man/dmmp_context_free.3
@@ -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
diff --git a/libdmmp/docs/man/dmmp_context_log_func_set.3 b/libdmmp/docs/man/dmmp_context_log_func_set.3
new file mode 100644
index 0000000..986793d
--- /dev/null
+++ b/libdmmp/docs/man/dmmp_context_log_func_set.3
@@ -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
diff --git a/libdmmp/docs/man/dmmp_context_log_priority_get.3 b/libdmmp/docs/man/dmmp_context_log_priority_get.3
new file mode 100644
index 0000000..9a273a2
--- /dev/null
+++ b/libdmmp/docs/man/dmmp_context_log_priority_get.3
@@ -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.
diff --git a/libdmmp/docs/man/dmmp_context_log_priority_set.3 b/libdmmp/docs/man/dmmp_context_log_priority_set.3
new file mode 100644
index 0000000..469c5a4
--- /dev/null
+++ b/libdmmp/docs/man/dmmp_context_log_priority_set.3
@@ -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
diff --git a/libdmmp/docs/man/dmmp_context_new.3 b/libdmmp/docs/man/dmmp_context_new.3
new file mode 100644
index 0000000..0eaeb00
--- /dev/null
+++ b/libdmmp/docs/man/dmmp_context_new.3
@@ -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.
diff --git a/libdmmp/docs/man/dmmp_context_timeout_get.3 b/libdmmp/docs/man/dmmp_context_timeout_get.3
new file mode 100644
index 0000000..1df2793
--- /dev/null
+++ b/libdmmp/docs/man/dmmp_context_timeout_get.3
@@ -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.
diff --git a/libdmmp/docs/man/dmmp_context_timeout_set.3 b/libdmmp/docs/man/dmmp_context_timeout_set.3
new file mode 100644
index 0000000..f3d7709
--- /dev/null
+++ b/libdmmp/docs/man/dmmp_context_timeout_set.3
@@ -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
diff --git a/libdmmp/docs/man/dmmp_context_userdata_get.3 b/libdmmp/docs/man/dmmp_context_userdata_get.3
new file mode 100644
index 0000000..fb713d5
--- /dev/null
+++ b/libdmmp/docs/man/dmmp_context_userdata_get.3
@@ -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.
diff --git a/libdmmp/docs/man/dmmp_context_userdata_set.3 b/libdmmp/docs/man/dmmp_context_userdata_set.3
new file mode 100644
index 0000000..c5bf63f
--- /dev/null
+++ b/libdmmp/docs/man/dmmp_context_userdata_set.3
@@ -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
diff --git a/libdmmp/docs/man/dmmp_flush_mpath.3 b/libdmmp/docs/man/dmmp_flush_mpath.3
new file mode 100644
index 0000000..cdfd526
--- /dev/null
+++ b/libdmmp/docs/man/dmmp_flush_mpath.3
@@ -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.
diff --git a/libdmmp/docs/man/dmmp_last_error_msg.3 b/libdmmp/docs/man/dmmp_last_error_msg.3
new file mode 100644
index 0000000..20acbc6
--- /dev/null
+++ b/libdmmp/docs/man/dmmp_last_error_msg.3
@@ -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.
diff --git a/libdmmp/docs/man/dmmp_log_priority_str.3 b/libdmmp/docs/man/dmmp_log_priority_str.3
new file mode 100644
index 0000000..3b5f828
--- /dev/null
+++ b/libdmmp/docs/man/dmmp_log_priority_str.3
@@ -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.
diff --git a/libdmmp/docs/man/dmmp_mpath_array_free.3 b/libdmmp/docs/man/dmmp_mpath_array_free.3
new file mode 100644
index 0000000..8c294e0
--- /dev/null
+++ b/libdmmp/docs/man/dmmp_mpath_array_free.3
@@ -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
diff --git a/libdmmp/docs/man/dmmp_mpath_array_get.3 b/libdmmp/docs/man/dmmp_mpath_array_get.3
new file mode 100644
index 0000000..e211db4
--- /dev/null
+++ b/libdmmp/docs/man/dmmp_mpath_array_get.3
@@ -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.
diff --git a/libdmmp/docs/man/dmmp_mpath_kdev_name_get.3 b/libdmmp/docs/man/dmmp_mpath_kdev_name_get.3
new file mode 100644
index 0000000..e802fe6
--- /dev/null
+++ b/libdmmp/docs/man/dmmp_mpath_kdev_name_get.3
@@ -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.
diff --git a/libdmmp/docs/man/dmmp_mpath_name_get.3 b/libdmmp/docs/man/dmmp_mpath_name_get.3
new file mode 100644
index 0000000..d70579e
--- /dev/null
+++ b/libdmmp/docs/man/dmmp_mpath_name_get.3
@@ -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.
diff --git a/libdmmp/docs/man/dmmp_mpath_wwid_get.3 b/libdmmp/docs/man/dmmp_mpath_wwid_get.3
new file mode 100644
index 0000000..3d060e9
--- /dev/null
+++ b/libdmmp/docs/man/dmmp_mpath_wwid_get.3
@@ -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.
diff --git a/libdmmp/docs/man/dmmp_path_array_get.3 b/libdmmp/docs/man/dmmp_path_array_get.3
new file mode 100644
index 0000000..53340b3
--- /dev/null
+++ b/libdmmp/docs/man/dmmp_path_array_get.3
@@ -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
diff --git a/libdmmp/docs/man/dmmp_path_blk_name_get.3 b/libdmmp/docs/man/dmmp_path_blk_name_get.3
new file mode 100644
index 0000000..da5f9f0
--- /dev/null
+++ b/libdmmp/docs/man/dmmp_path_blk_name_get.3
@@ -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.
diff --git a/libdmmp/docs/man/dmmp_path_group_array_get.3 b/libdmmp/docs/man/dmmp_path_group_array_get.3
new file mode 100644
index 0000000..6eee4a2
--- /dev/null
+++ b/libdmmp/docs/man/dmmp_path_group_array_get.3
@@ -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
diff --git a/libdmmp/docs/man/dmmp_path_group_id_get.3 b/libdmmp/docs/man/dmmp_path_group_id_get.3
new file mode 100644
index 0000000..4f07b53
--- /dev/null
+++ b/libdmmp/docs/man/dmmp_path_group_id_get.3
@@ -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.
diff --git a/libdmmp/docs/man/dmmp_path_group_priority_get.3 b/libdmmp/docs/man/dmmp_path_group_priority_get.3
new file mode 100644
index 0000000..a48b270
--- /dev/null
+++ b/libdmmp/docs/man/dmmp_path_group_priority_get.3
@@ -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.
diff --git a/libdmmp/docs/man/dmmp_path_group_selector_get.3 b/libdmmp/docs/man/dmmp_path_group_selector_get.3
new file mode 100644
index 0000000..407b3f4
--- /dev/null
+++ b/libdmmp/docs/man/dmmp_path_group_selector_get.3
@@ -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 *.
diff --git a/libdmmp/docs/man/dmmp_path_group_status_get.3 b/libdmmp/docs/man/dmmp_path_group_status_get.3
new file mode 100644
index 0000000..a81aeb3
--- /dev/null
+++ b/libdmmp/docs/man/dmmp_path_group_status_get.3
@@ -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.
diff --git a/libdmmp/docs/man/dmmp_path_group_status_str.3 b/libdmmp/docs/man/dmmp_path_group_status_str.3
new file mode 100644
index 0000000..e4a9f74
--- /dev/null
+++ b/libdmmp/docs/man/dmmp_path_group_status_str.3
@@ -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"
diff --git a/libdmmp/docs/man/dmmp_path_status_get.3 b/libdmmp/docs/man/dmmp_path_status_get.3
new file mode 100644
index 0000000..025cfee
--- /dev/null
+++ b/libdmmp/docs/man/dmmp_path_status_get.3
@@ -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.
diff --git a/libdmmp/docs/man/dmmp_path_status_str.3 b/libdmmp/docs/man/dmmp_path_status_str.3
new file mode 100644
index 0000000..3944d39
--- /dev/null
+++ b/libdmmp/docs/man/dmmp_path_status_str.3
@@ -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.
diff --git a/libdmmp/docs/man/dmmp_reconfig.3 b/libdmmp/docs/man/dmmp_reconfig.3
new file mode 100644
index 0000000..a743e30
--- /dev/null
+++ b/libdmmp/docs/man/dmmp_reconfig.3
@@ -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.
diff --git a/libdmmp/docs/man/dmmp_strerror.3 b/libdmmp/docs/man/dmmp_strerror.3
new file mode 100644
index 0000000..4d753d3
--- /dev/null
+++ b/libdmmp/docs/man/dmmp_strerror.3
@@ -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.
diff --git a/libdmmp/docs/libdmmp.h.3 b/libdmmp/docs/man/libdmmp.h.3
similarity index 100%
rename from libdmmp/docs/libdmmp.h.3
rename to libdmmp/docs/man/libdmmp.h.3
-- 
2.30.1


--
dm-devel mailing list
dm-devel@redhat.com
https://listman.redhat.com/mailman/listinfo/dm-devel


^ permalink raw reply related	[flat|nested] 23+ messages in thread

* [dm-devel] [PATCH 5/7] multipath-tools Makefile: build before install
  2021-03-26 21:29 [dm-devel] [PATCH 0/7] multipath-tools: extended github CI mwilck
                   ` (3 preceding siblings ...)
  2021-03-26 21:29 ` [dm-devel] [PATCH 4/7] libdmmp: allow building without perl mwilck
@ 2021-03-26 21:29 ` mwilck
  2021-03-26 21:29 ` [dm-devel] [PATCH 6/7] fixup "multipath-tools tests: check if /sys/dev/block is non-empty" mwilck
                   ` (2 subsequent siblings)
  7 siblings, 0 replies; 23+ messages in thread
From: mwilck @ 2021-03-26 21:29 UTC (permalink / raw)
  To: Christophe Varoqui, Benjamin Marzinski
  Cc: dm-devel, Xose Vazquez Perez, Martin Wilck

From: Martin Wilck <mwilck@suse.com>

"make install" in a clean directory fails. Fix it by making "all"
a dependency of "install".

Signed-off-by: Martin Wilck <mwilck@suse.com>
---
 Makefile | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/Makefile b/Makefile
index c5bedcf..7f21db8 100644
--- a/Makefile
+++ b/Makefile
@@ -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
-- 
2.30.1


--
dm-devel mailing list
dm-devel@redhat.com
https://listman.redhat.com/mailman/listinfo/dm-devel


^ permalink raw reply related	[flat|nested] 23+ messages in thread

* [dm-devel] [PATCH 6/7] fixup "multipath-tools tests: check if /sys/dev/block is non-empty"
  2021-03-26 21:29 [dm-devel] [PATCH 0/7] multipath-tools: extended github CI mwilck
                   ` (4 preceding siblings ...)
  2021-03-26 21:29 ` [dm-devel] [PATCH 5/7] multipath-tools Makefile: build before install mwilck
@ 2021-03-26 21:29 ` mwilck
  2021-03-26 21:29 ` [dm-devel] [PATCH 7/7] libmultipath: fix warning with clang 3.5 mwilck
  2021-03-30  4:26 ` [dm-devel] [PATCH 0/7] multipath-tools: extended github CI Benjamin Marzinski
  7 siblings, 0 replies; 23+ messages in thread
From: mwilck @ 2021-03-26 21:29 UTC (permalink / raw)
  To: Christophe Varoqui, Benjamin Marzinski
  Cc: dm-devel, Xose Vazquez Perez, Martin Wilck

From: Martin Wilck <mwilck@suse.com>

Don't run closedir() if opendir() failed.

Fixes: "multipath-tools tests: check if /sys/dev/block is non-empty"
Signed-off-by: Martin Wilck <mwilck@suse.com>
---
 tests/devt.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tests/devt.c b/tests/devt.c
index d971302..0ad100a 100644
--- a/tests/devt.c
+++ b/tests/devt.c
@@ -37,8 +37,8 @@ static bool sys_dev_block_exists(void)
 				break;
 			}
 		}
+		closedir(dir);
 	}
-	closedir(dir);
 	return rc;
 }
 
-- 
2.30.1


--
dm-devel mailing list
dm-devel@redhat.com
https://listman.redhat.com/mailman/listinfo/dm-devel


^ permalink raw reply related	[flat|nested] 23+ messages in thread

* [dm-devel] [PATCH 7/7] libmultipath: fix warning with clang 3.5
  2021-03-26 21:29 [dm-devel] [PATCH 0/7] multipath-tools: extended github CI mwilck
                   ` (5 preceding siblings ...)
  2021-03-26 21:29 ` [dm-devel] [PATCH 6/7] fixup "multipath-tools tests: check if /sys/dev/block is non-empty" mwilck
@ 2021-03-26 21:29 ` mwilck
  2021-03-30  4:26 ` [dm-devel] [PATCH 0/7] multipath-tools: extended github CI Benjamin Marzinski
  7 siblings, 0 replies; 23+ messages in thread
From: mwilck @ 2021-03-26 21:29 UTC (permalink / raw)
  To: Christophe Varoqui, Benjamin Marzinski
  Cc: dm-devel, Xose Vazquez Perez, Martin Wilck

From: Martin Wilck <mwilck@suse.com>

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,};

Signed-off-by: Martin Wilck <mwilck@suse.com>
---
 libmultipath/io_err_stat.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/libmultipath/io_err_stat.c b/libmultipath/io_err_stat.c
index abdd0b4..d8d91f6 100644
--- a/libmultipath/io_err_stat.c
+++ b/libmultipath/io_err_stat.c
@@ -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;
-- 
2.30.1


--
dm-devel mailing list
dm-devel@redhat.com
https://listman.redhat.com/mailman/listinfo/dm-devel


^ permalink raw reply related	[flat|nested] 23+ messages in thread

* Re: [dm-devel] [PATCH 1/7] multipath-tools Makefiles: make pkg-config configurable
  2021-03-26 21:29 ` [dm-devel] [PATCH 1/7] multipath-tools Makefiles: make pkg-config configurable mwilck
@ 2021-03-29 15:44   ` Xose Vazquez Perez
  2021-03-29 15:57     ` Martin Wilck
  0 siblings, 1 reply; 23+ messages in thread
From: Xose Vazquez Perez @ 2021-03-29 15:44 UTC (permalink / raw)
  To: mwilck, Christophe Varoqui, Benjamin Marzinski, Helmut Grohne; +Cc: dm-devel

On 3/26/21 10:29 PM, mwilck@suse.com wrote:

> From: Martin Wilck <mwilck@suse.com>
> 
> 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


> Signed-off-by: Martin Wilck <mwilck@suse.com>
> ---
>   Makefile.inc     | 6 ++++--
>   libdmmp/Makefile | 4 ++--
>   2 files changed, 6 insertions(+), 4 deletions(-)
> 
> diff --git a/Makefile.inc b/Makefile.inc
> index 0542930..f1e2313 100644
> --- a/Makefile.inc
> +++ b/Makefile.inc
> @@ -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 | \
> diff --git a/libdmmp/Makefile b/libdmmp/Makefile
> index 1dd3f34..4175c3f 100644
> --- a/libdmmp/Makefile
> +++ b/libdmmp/Makefile
> @@ -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
>   
> 

--
dm-devel mailing list
dm-devel@redhat.com
https://listman.redhat.com/mailman/listinfo/dm-devel


^ permalink raw reply	[flat|nested] 23+ messages in thread

* Re: [dm-devel] [PATCH 1/7] multipath-tools Makefiles: make pkg-config configurable
  2021-03-29 15:44   ` Xose Vazquez Perez
@ 2021-03-29 15:57     ` Martin Wilck
  0 siblings, 0 replies; 23+ messages in thread
From: Martin Wilck @ 2021-03-29 15:57 UTC (permalink / raw)
  To: Xose Vazquez Perez, Christophe Varoqui, Benjamin Marzinski,
	Helmut Grohne
  Cc: dm-devel

On Mon, 2021-03-29 at 17:44 +0200, Xose Vazquez Perez wrote:
> On 3/26/21 10:29 PM, mwilck@suse.com wrote:
> 
> > From: Martin Wilck <mwilck@suse.com>
> > 
> > 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
dm-devel@redhat.com
https://listman.redhat.com/mailman/listinfo/dm-devel


^ permalink raw reply	[flat|nested] 23+ messages in thread

* Re: [dm-devel] [PATCH 3/7] github workflows: add containerized / multi-arch tests
  2021-03-26 21:29 ` [dm-devel] [PATCH 3/7] github workflows: add containerized / multi-arch tests mwilck
@ 2021-03-30  3:23   ` Benjamin Marzinski
  2021-03-30  9:00     ` Martin Wilck
  2021-03-30  9:00     ` Martin Wilck
  0 siblings, 2 replies; 23+ messages in thread
From: Benjamin Marzinski @ 2021-03-30  3:23 UTC (permalink / raw)
  To: mwilck; +Cc: dm-devel, Xose Vazquez Perez

On Fri, Mar 26, 2021 at 10:29:40PM +0100, mwilck@suse.com wrote:
> From: Martin Wilck <mwilck@suse.com>
> 
> 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.

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
 
> Signed-off-by: Martin Wilck <mwilck@suse.com>
> ---
>  .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
> 
> diff --git a/.github/workflows/build-and-unittest.yaml b/.github/workflows/build-and-unittest.yaml
> index 4173576..bf37b13 100644
> --- a/.github/workflows/build-and-unittest.yaml
> +++ b/.github/workflows/build-and-unittest.yaml
> @@ -1,5 +1,7 @@
>  name: basic-build-and-ci
> -on:   [push]
> +on:
> +  push:
> +    branches: [master queue tip]
>  jobs:
>    bionic:
>      runs-on: ubuntu-18.04
> diff --git a/.github/workflows/foreign.yaml b/.github/workflows/foreign.yaml
> new file mode 100644
> index 0000000..505a777
> --- /dev/null
> +++ b/.github/workflows/foreign.yaml
> @@ -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
> diff --git a/.github/workflows/native.yaml b/.github/workflows/native.yaml
> new file mode 100644
> index 0000000..abd39a0
> --- /dev/null
> +++ b/.github/workflows/native.yaml
> @@ -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
> +
> -- 
> 2.30.1

--
dm-devel mailing list
dm-devel@redhat.com
https://listman.redhat.com/mailman/listinfo/dm-devel


^ permalink raw reply	[flat|nested] 23+ messages in thread

* Re: [dm-devel] [PATCH 4/7] libdmmp: allow building without perl
  2021-03-26 21:29 ` [dm-devel] [PATCH 4/7] libdmmp: allow building without perl mwilck
@ 2021-03-30  4:25   ` Benjamin Marzinski
  2021-03-30  8:00     ` Martin Wilck
  2021-05-17 19:47   ` Xose Vazquez Perez
  1 sibling, 1 reply; 23+ messages in thread
From: Benjamin Marzinski @ 2021-03-30  4:25 UTC (permalink / raw)
  To: mwilck; +Cc: dm-devel, Xose Vazquez Perez

On Fri, Mar 26, 2021 at 10:29:41PM +0100, mwilck@suse.com wrote:
> From: Martin Wilck <mwilck@suse.com>
> 
> 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.

Git complains about a bunch of trailing whitespace issues here, but this
is a great idea.

-Ben

> 
> Signed-off-by: Martin Wilck <mwilck@suse.com>
> ---
>  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%)
> 
> diff --git a/libdmmp/Makefile b/libdmmp/Makefile
> index 4175c3f..764a0bc 100644
> --- a/libdmmp/Makefile
> +++ b/libdmmp/Makefile
> @@ -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)
> diff --git a/libdmmp/docs/man/dmmp_context_free.3 b/libdmmp/docs/man/dmmp_context_free.3
> new file mode 100644
> index 0000000..0d26f42
> --- /dev/null
> +++ b/libdmmp/docs/man/dmmp_context_free.3
> @@ -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
> diff --git a/libdmmp/docs/man/dmmp_context_log_func_set.3 b/libdmmp/docs/man/dmmp_context_log_func_set.3
> new file mode 100644
> index 0000000..986793d
> --- /dev/null
> +++ b/libdmmp/docs/man/dmmp_context_log_func_set.3
> @@ -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
> diff --git a/libdmmp/docs/man/dmmp_context_log_priority_get.3 b/libdmmp/docs/man/dmmp_context_log_priority_get.3
> new file mode 100644
> index 0000000..9a273a2
> --- /dev/null
> +++ b/libdmmp/docs/man/dmmp_context_log_priority_get.3
> @@ -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.
> diff --git a/libdmmp/docs/man/dmmp_context_log_priority_set.3 b/libdmmp/docs/man/dmmp_context_log_priority_set.3
> new file mode 100644
> index 0000000..469c5a4
> --- /dev/null
> +++ b/libdmmp/docs/man/dmmp_context_log_priority_set.3
> @@ -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
> diff --git a/libdmmp/docs/man/dmmp_context_new.3 b/libdmmp/docs/man/dmmp_context_new.3
> new file mode 100644
> index 0000000..0eaeb00
> --- /dev/null
> +++ b/libdmmp/docs/man/dmmp_context_new.3
> @@ -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.
> diff --git a/libdmmp/docs/man/dmmp_context_timeout_get.3 b/libdmmp/docs/man/dmmp_context_timeout_get.3
> new file mode 100644
> index 0000000..1df2793
> --- /dev/null
> +++ b/libdmmp/docs/man/dmmp_context_timeout_get.3
> @@ -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.
> diff --git a/libdmmp/docs/man/dmmp_context_timeout_set.3 b/libdmmp/docs/man/dmmp_context_timeout_set.3
> new file mode 100644
> index 0000000..f3d7709
> --- /dev/null
> +++ b/libdmmp/docs/man/dmmp_context_timeout_set.3
> @@ -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
> diff --git a/libdmmp/docs/man/dmmp_context_userdata_get.3 b/libdmmp/docs/man/dmmp_context_userdata_get.3
> new file mode 100644
> index 0000000..fb713d5
> --- /dev/null
> +++ b/libdmmp/docs/man/dmmp_context_userdata_get.3
> @@ -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.
> diff --git a/libdmmp/docs/man/dmmp_context_userdata_set.3 b/libdmmp/docs/man/dmmp_context_userdata_set.3
> new file mode 100644
> index 0000000..c5bf63f
> --- /dev/null
> +++ b/libdmmp/docs/man/dmmp_context_userdata_set.3
> @@ -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
> diff --git a/libdmmp/docs/man/dmmp_flush_mpath.3 b/libdmmp/docs/man/dmmp_flush_mpath.3
> new file mode 100644
> index 0000000..cdfd526
> --- /dev/null
> +++ b/libdmmp/docs/man/dmmp_flush_mpath.3
> @@ -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.
> diff --git a/libdmmp/docs/man/dmmp_last_error_msg.3 b/libdmmp/docs/man/dmmp_last_error_msg.3
> new file mode 100644
> index 0000000..20acbc6
> --- /dev/null
> +++ b/libdmmp/docs/man/dmmp_last_error_msg.3
> @@ -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.
> diff --git a/libdmmp/docs/man/dmmp_log_priority_str.3 b/libdmmp/docs/man/dmmp_log_priority_str.3
> new file mode 100644
> index 0000000..3b5f828
> --- /dev/null
> +++ b/libdmmp/docs/man/dmmp_log_priority_str.3
> @@ -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.
> diff --git a/libdmmp/docs/man/dmmp_mpath_array_free.3 b/libdmmp/docs/man/dmmp_mpath_array_free.3
> new file mode 100644
> index 0000000..8c294e0
> --- /dev/null
> +++ b/libdmmp/docs/man/dmmp_mpath_array_free.3
> @@ -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
> diff --git a/libdmmp/docs/man/dmmp_mpath_array_get.3 b/libdmmp/docs/man/dmmp_mpath_array_get.3
> new file mode 100644
> index 0000000..e211db4
> --- /dev/null
> +++ b/libdmmp/docs/man/dmmp_mpath_array_get.3
> @@ -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.
> diff --git a/libdmmp/docs/man/dmmp_mpath_kdev_name_get.3 b/libdmmp/docs/man/dmmp_mpath_kdev_name_get.3
> new file mode 100644
> index 0000000..e802fe6
> --- /dev/null
> +++ b/libdmmp/docs/man/dmmp_mpath_kdev_name_get.3
> @@ -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.
> diff --git a/libdmmp/docs/man/dmmp_mpath_name_get.3 b/libdmmp/docs/man/dmmp_mpath_name_get.3
> new file mode 100644
> index 0000000..d70579e
> --- /dev/null
> +++ b/libdmmp/docs/man/dmmp_mpath_name_get.3
> @@ -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.
> diff --git a/libdmmp/docs/man/dmmp_mpath_wwid_get.3 b/libdmmp/docs/man/dmmp_mpath_wwid_get.3
> new file mode 100644
> index 0000000..3d060e9
> --- /dev/null
> +++ b/libdmmp/docs/man/dmmp_mpath_wwid_get.3
> @@ -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.
> diff --git a/libdmmp/docs/man/dmmp_path_array_get.3 b/libdmmp/docs/man/dmmp_path_array_get.3
> new file mode 100644
> index 0000000..53340b3
> --- /dev/null
> +++ b/libdmmp/docs/man/dmmp_path_array_get.3
> @@ -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
> diff --git a/libdmmp/docs/man/dmmp_path_blk_name_get.3 b/libdmmp/docs/man/dmmp_path_blk_name_get.3
> new file mode 100644
> index 0000000..da5f9f0
> --- /dev/null
> +++ b/libdmmp/docs/man/dmmp_path_blk_name_get.3
> @@ -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.
> diff --git a/libdmmp/docs/man/dmmp_path_group_array_get.3 b/libdmmp/docs/man/dmmp_path_group_array_get.3
> new file mode 100644
> index 0000000..6eee4a2
> --- /dev/null
> +++ b/libdmmp/docs/man/dmmp_path_group_array_get.3
> @@ -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
> diff --git a/libdmmp/docs/man/dmmp_path_group_id_get.3 b/libdmmp/docs/man/dmmp_path_group_id_get.3
> new file mode 100644
> index 0000000..4f07b53
> --- /dev/null
> +++ b/libdmmp/docs/man/dmmp_path_group_id_get.3
> @@ -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.
> diff --git a/libdmmp/docs/man/dmmp_path_group_priority_get.3 b/libdmmp/docs/man/dmmp_path_group_priority_get.3
> new file mode 100644
> index 0000000..a48b270
> --- /dev/null
> +++ b/libdmmp/docs/man/dmmp_path_group_priority_get.3
> @@ -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.
> diff --git a/libdmmp/docs/man/dmmp_path_group_selector_get.3 b/libdmmp/docs/man/dmmp_path_group_selector_get.3
> new file mode 100644
> index 0000000..407b3f4
> --- /dev/null
> +++ b/libdmmp/docs/man/dmmp_path_group_selector_get.3
> @@ -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 *.
> diff --git a/libdmmp/docs/man/dmmp_path_group_status_get.3 b/libdmmp/docs/man/dmmp_path_group_status_get.3
> new file mode 100644
> index 0000000..a81aeb3
> --- /dev/null
> +++ b/libdmmp/docs/man/dmmp_path_group_status_get.3
> @@ -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.
> diff --git a/libdmmp/docs/man/dmmp_path_group_status_str.3 b/libdmmp/docs/man/dmmp_path_group_status_str.3
> new file mode 100644
> index 0000000..e4a9f74
> --- /dev/null
> +++ b/libdmmp/docs/man/dmmp_path_group_status_str.3
> @@ -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"
> diff --git a/libdmmp/docs/man/dmmp_path_status_get.3 b/libdmmp/docs/man/dmmp_path_status_get.3
> new file mode 100644
> index 0000000..025cfee
> --- /dev/null
> +++ b/libdmmp/docs/man/dmmp_path_status_get.3
> @@ -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.
> diff --git a/libdmmp/docs/man/dmmp_path_status_str.3 b/libdmmp/docs/man/dmmp_path_status_str.3
> new file mode 100644
> index 0000000..3944d39
> --- /dev/null
> +++ b/libdmmp/docs/man/dmmp_path_status_str.3
> @@ -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.
> diff --git a/libdmmp/docs/man/dmmp_reconfig.3 b/libdmmp/docs/man/dmmp_reconfig.3
> new file mode 100644
> index 0000000..a743e30
> --- /dev/null
> +++ b/libdmmp/docs/man/dmmp_reconfig.3
> @@ -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.
> diff --git a/libdmmp/docs/man/dmmp_strerror.3 b/libdmmp/docs/man/dmmp_strerror.3
> new file mode 100644
> index 0000000..4d753d3
> --- /dev/null
> +++ b/libdmmp/docs/man/dmmp_strerror.3
> @@ -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.
> diff --git a/libdmmp/docs/libdmmp.h.3 b/libdmmp/docs/man/libdmmp.h.3
> similarity index 100%
> rename from libdmmp/docs/libdmmp.h.3
> rename to libdmmp/docs/man/libdmmp.h.3
> -- 
> 2.30.1

--
dm-devel mailing list
dm-devel@redhat.com
https://listman.redhat.com/mailman/listinfo/dm-devel


^ permalink raw reply	[flat|nested] 23+ messages in thread

* Re: [dm-devel] [PATCH 0/7] multipath-tools: extended github CI
  2021-03-26 21:29 [dm-devel] [PATCH 0/7] multipath-tools: extended github CI mwilck
                   ` (6 preceding siblings ...)
  2021-03-26 21:29 ` [dm-devel] [PATCH 7/7] libmultipath: fix warning with clang 3.5 mwilck
@ 2021-03-30  4:26 ` Benjamin Marzinski
  7 siblings, 0 replies; 23+ messages in thread
From: Benjamin Marzinski @ 2021-03-30  4:26 UTC (permalink / raw)
  To: mwilck; +Cc: dm-devel, Xose Vazquez Perez

On Fri, Mar 26, 2021 at 10:29:37PM +0100, mwilck@suse.com wrote:
> From: Martin Wilck <mwilck@suse.com>
> 
> Hi Christophe, hi Ben,

For the set
Reviewed-by: Benjamin Marzinski <bmarzins@redhat.com>

 
> 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%)
> 
> -- 
> 2.30.1

--
dm-devel mailing list
dm-devel@redhat.com
https://listman.redhat.com/mailman/listinfo/dm-devel


^ permalink raw reply	[flat|nested] 23+ messages in thread

* Re: [dm-devel] [PATCH 4/7] libdmmp: allow building without perl
  2021-03-30  4:25   ` Benjamin Marzinski
@ 2021-03-30  8:00     ` Martin Wilck
  2021-03-30 16:59       ` Benjamin Marzinski
  0 siblings, 1 reply; 23+ messages in thread
From: Martin Wilck @ 2021-03-30  8:00 UTC (permalink / raw)
  To: Benjamin Marzinski; +Cc: dm-devel, Xose Vazquez Perez

On Mon, 2021-03-29 at 23:25 -0500, Benjamin Marzinski wrote:
> On Fri, Mar 26, 2021 at 10:29:41PM +0100, mwilck@suse.com wrote:
> > From: Martin Wilck <mwilck@suse.com>
> > 
> > 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.
> 
> 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
dm-devel@redhat.com
https://listman.redhat.com/mailman/listinfo/dm-devel


^ permalink raw reply	[flat|nested] 23+ messages in thread

* Re: [dm-devel] [PATCH 3/7] github workflows: add containerized / multi-arch tests
  2021-03-30  3:23   ` Benjamin Marzinski
@ 2021-03-30  9:00     ` Martin Wilck
  2021-03-30  9:00     ` Martin Wilck
  1 sibling, 0 replies; 23+ messages in thread
From: Martin Wilck @ 2021-03-30  9:00 UTC (permalink / raw)
  To: Benjamin Marzinski; +Cc: dm-devel, Xose Vazquez Perez

On Mon, 2021-03-29 at 22:23 -0500, Benjamin Marzinski wrote:
> On Fri, Mar 26, 2021 at 10:29:40PM +0100, mwilck@suse.com wrote:
> 
> > 
> > diff --git a/.github/workflows/build-and-unittest.yaml
> > b/.github/workflows/build-and-unittest.yaml
> > index 4173576..bf37b13 100644
> > --- a/.github/workflows/build-and-unittest.yaml
> > +++ b/.github/workflows/build-and-unittest.yaml
> > @@ -1,5 +1,7 @@
> >  name: basic-build-and-ci
> > -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
dm-devel@redhat.com
https://listman.redhat.com/mailman/listinfo/dm-devel


^ permalink raw reply	[flat|nested] 23+ messages in thread

* Re: [dm-devel] [PATCH 3/7] github workflows: add containerized / multi-arch tests
  2021-03-30  3:23   ` Benjamin Marzinski
  2021-03-30  9:00     ` Martin Wilck
@ 2021-03-30  9:00     ` Martin Wilck
  2021-03-30 16:55       ` Benjamin Marzinski
  1 sibling, 1 reply; 23+ messages in thread
From: Martin Wilck @ 2021-03-30  9:00 UTC (permalink / raw)
  To: Benjamin Marzinski, Christophe Varoqui; +Cc: dm-devel, Xose Vazquez Perez

On Mon, 2021-03-29 at 22:23 -0500, Benjamin Marzinski wrote:
> On Fri, Mar 26, 2021 at 10:29:40PM +0100, mwilck@suse.com 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.
> 
> 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
dm-devel@redhat.com
https://listman.redhat.com/mailman/listinfo/dm-devel


^ permalink raw reply	[flat|nested] 23+ messages in thread

* Re: [dm-devel] [PATCH 3/7] github workflows: add containerized / multi-arch tests
  2021-03-30  9:00     ` Martin Wilck
@ 2021-03-30 16:55       ` Benjamin Marzinski
  0 siblings, 0 replies; 23+ messages in thread
From: Benjamin Marzinski @ 2021-03-30 16:55 UTC (permalink / raw)
  To: Martin Wilck; +Cc: dm-devel, Xose Vazquez Perez

On Tue, Mar 30, 2021 at 11:00:56AM +0200, Martin Wilck wrote:
> On Mon, 2021-03-29 at 22:23 -0500, Benjamin Marzinski wrote:
> > On Fri, Mar 26, 2021 at 10:29:40PM +0100, mwilck@suse.com 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.
> > 
> > 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.


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

> 
> 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
dm-devel@redhat.com
https://listman.redhat.com/mailman/listinfo/dm-devel


^ permalink raw reply	[flat|nested] 23+ messages in thread

* Re: [dm-devel] [PATCH 4/7] libdmmp: allow building without perl
  2021-03-30  8:00     ` Martin Wilck
@ 2021-03-30 16:59       ` Benjamin Marzinski
  0 siblings, 0 replies; 23+ messages in thread
From: Benjamin Marzinski @ 2021-03-30 16:59 UTC (permalink / raw)
  To: Martin Wilck; +Cc: dm-devel, Xose Vazquez Perez

On Tue, Mar 30, 2021 at 10:00:02AM +0200, Martin Wilck wrote:
> On Mon, 2021-03-29 at 23:25 -0500, Benjamin Marzinski wrote:
> > On Fri, Mar 26, 2021 at 10:29:41PM +0100, mwilck@suse.com wrote:
> > > From: Martin Wilck <mwilck@suse.com>
> > > 
> > > 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.
> > 
> > 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

> 
> Thanks,
> Martin
> 

--
dm-devel mailing list
dm-devel@redhat.com
https://listman.redhat.com/mailman/listinfo/dm-devel


^ permalink raw reply	[flat|nested] 23+ messages in thread

* Re: [dm-devel] [PATCH 4/7] libdmmp: allow building without perl
  2021-03-26 21:29 ` [dm-devel] [PATCH 4/7] libdmmp: allow building without perl mwilck
  2021-03-30  4:25   ` Benjamin Marzinski
@ 2021-05-17 19:47   ` Xose Vazquez Perez
  2021-05-17 20:04     ` Martin Wilck
  1 sibling, 1 reply; 23+ messages in thread
From: Xose Vazquez Perez @ 2021-05-17 19:47 UTC (permalink / raw)
  To: Martin Wilck, Benjamin Marzinski; +Cc: dm-devel

On 3/26/21 10:29 PM, mwilck@suse.com wrote:

> Add the kernel-doc generated manpages of libdmmp to git, and
> change the libdmmp Makefile to regenerate them (only) when
> necessary.

Every month, nice try :-)


$ git diff
diff --git a/libdmmp/docs/man/dmmp_context_free.3 b/libdmmp/docs/man/dmmp_context_free.3
index 0d26f42c..9a46950e 100644
--- a/libdmmp/docs/man/dmmp_context_free.3
+++ b/libdmmp/docs/man/dmmp_context_free.3
@@ -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
dm-devel@redhat.com
https://listman.redhat.com/mailman/listinfo/dm-devel


^ permalink raw reply related	[flat|nested] 23+ messages in thread

* Re: [dm-devel] [PATCH 4/7] libdmmp: allow building without perl
  2021-05-17 19:47   ` Xose Vazquez Perez
@ 2021-05-17 20:04     ` Martin Wilck
  2021-05-17 20:08       ` Xose Vazquez Perez
  0 siblings, 1 reply; 23+ messages in thread
From: Martin Wilck @ 2021-05-17 20:04 UTC (permalink / raw)
  To: Xose Vazquez Perez, Benjamin Marzinski; +Cc: dm-devel

On Mon, 2021-05-17 at 21:47 +0200, Xose Vazquez Perez wrote:
> On 3/26/21 10:29 PM, mwilck@suse.com wrote:
> 
> > Add the kernel-doc generated manpages of libdmmp to git, and
> > change the libdmmp Makefile to 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


> $ git diff
> diff --git a/libdmmp/docs/man/dmmp_context_free.3
> b/libdmmp/docs/man/dmmp_context_free.3
> index 0d26f42c..9a46950e 100644
> --- a/libdmmp/docs/man/dmmp_context_free.3
> +++ b/libdmmp/docs/man/dmmp_context_free.3
> @@ -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
dm-devel@redhat.com
https://listman.redhat.com/mailman/listinfo/dm-devel


^ permalink raw reply	[flat|nested] 23+ messages in thread

* Re: [dm-devel] [PATCH 4/7] libdmmp: allow building without perl
  2021-05-17 20:04     ` Martin Wilck
@ 2021-05-17 20:08       ` Xose Vazquez Perez
  2021-05-17 21:10         ` Martin Wilck
  0 siblings, 1 reply; 23+ messages in thread
From: Xose Vazquez Perez @ 2021-05-17 20:08 UTC (permalink / raw)
  To: Martin Wilck, Benjamin Marzinski; +Cc: dm-devel

On 5/17/21 10:04 PM, Martin Wilck wrote:

> On Mon, 2021-05-17 at 21:47 +0200, Xose Vazquez Perez wrote:
>> On 3/26/21 10:29 PM, mwilck@suse.com wrote:
>>
>>> Add the kernel-doc generated manpages of libdmmp to git, and
>>> change the libdmmp Makefile to 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.

Just:
$ git clone -b queue  https://github.com/openSUSE/multipath-tools
$ make
$ git diff

--
dm-devel mailing list
dm-devel@redhat.com
https://listman.redhat.com/mailman/listinfo/dm-devel


^ permalink raw reply	[flat|nested] 23+ messages in thread

* Re: [dm-devel] [PATCH 4/7] libdmmp: allow building without perl
  2021-05-17 20:08       ` Xose Vazquez Perez
@ 2021-05-17 21:10         ` Martin Wilck
  2021-05-17 21:31           ` Martin Wilck
  0 siblings, 1 reply; 23+ messages in thread
From: Martin Wilck @ 2021-05-17 21:10 UTC (permalink / raw)
  To: Xose Vazquez Perez, Benjamin Marzinski; +Cc: dm-devel

On Mon, 2021-05-17 at 22:08 +0200, Xose Vazquez Perez wrote:
> On 5/17/21 10:04 PM, Martin Wilck wrote:
> 
> > On Mon, 2021-05-17 at 21:47 +0200, Xose Vazquez Perez wrote:
> > > On 3/26/21 10:29 PM, mwilck@suse.com wrote:
> > > 
> > > > Add the kernel-doc generated manpages of libdmmp to git, and
> > > > change the libdmmp Makefile to 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.
> 
> 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
dm-devel@redhat.com
https://listman.redhat.com/mailman/listinfo/dm-devel


^ permalink raw reply	[flat|nested] 23+ messages in thread

* Re: [dm-devel] [PATCH 4/7] libdmmp: allow building without perl
  2021-05-17 21:10         ` Martin Wilck
@ 2021-05-17 21:31           ` Martin Wilck
  0 siblings, 0 replies; 23+ messages in thread
From: Martin Wilck @ 2021-05-17 21:31 UTC (permalink / raw)
  To: Xose Vazquez Perez, Benjamin Marzinski; +Cc: dm-devel

On Mon, 2021-05-17 at 23:10 +0200, Martin Wilck wrote:
> On Mon, 2021-05-17 at 22:08 +0200, Xose Vazquez Perez wrote:
> > On 5/17/21 10:04 PM, Martin Wilck wrote:
> > 
> > > On Mon, 2021-05-17 at 21:47 +0200, Xose Vazquez Perez wrote:
> > > > On 3/26/21 10:29 PM, mwilck@suse.com wrote:
> > > > 
> > > > > Add the kernel-doc generated manpages of libdmmp to git, and
> > > > > change the libdmmp Makefile to 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.
> > 
> > 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.

It should work now if you clone the "tip" branch. Please test.

Martin



--
dm-devel mailing list
dm-devel@redhat.com
https://listman.redhat.com/mailman/listinfo/dm-devel


^ permalink raw reply	[flat|nested] 23+ messages in thread

end of thread, other threads:[~2021-05-17 21:31 UTC | newest]

Thread overview: 23+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-03-26 21:29 [dm-devel] [PATCH 0/7] multipath-tools: extended github CI mwilck
2021-03-26 21:29 ` [dm-devel] [PATCH 1/7] multipath-tools Makefiles: make pkg-config configurable mwilck
2021-03-29 15:44   ` Xose Vazquez Perez
2021-03-29 15:57     ` Martin Wilck
2021-03-26 21:29 ` [dm-devel] [PATCH 2/7] multipath-tools Makefiles: allow building test programs only mwilck
2021-03-26 21:29 ` [dm-devel] [PATCH 3/7] github workflows: add containerized / multi-arch tests mwilck
2021-03-30  3:23   ` Benjamin Marzinski
2021-03-30  9:00     ` Martin Wilck
2021-03-30  9:00     ` Martin Wilck
2021-03-30 16:55       ` Benjamin Marzinski
2021-03-26 21:29 ` [dm-devel] [PATCH 4/7] libdmmp: allow building without perl mwilck
2021-03-30  4:25   ` Benjamin Marzinski
2021-03-30  8:00     ` Martin Wilck
2021-03-30 16:59       ` Benjamin Marzinski
2021-05-17 19:47   ` Xose Vazquez Perez
2021-05-17 20:04     ` Martin Wilck
2021-05-17 20:08       ` Xose Vazquez Perez
2021-05-17 21:10         ` Martin Wilck
2021-05-17 21:31           ` Martin Wilck
2021-03-26 21:29 ` [dm-devel] [PATCH 5/7] multipath-tools Makefile: build before install mwilck
2021-03-26 21:29 ` [dm-devel] [PATCH 6/7] fixup "multipath-tools tests: check if /sys/dev/block is non-empty" mwilck
2021-03-26 21:29 ` [dm-devel] [PATCH 7/7] libmultipath: fix warning with clang 3.5 mwilck
2021-03-30  4:26 ` [dm-devel] [PATCH 0/7] multipath-tools: extended github CI Benjamin Marzinski

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.