Skip to content

Commit

Permalink
Merge pull request opensvc#94 from openSUSE/queue
Browse files Browse the repository at this point in the history
multipath-tools 0.10.0
  • Loading branch information
cvaroqui authored Aug 27, 2024
2 parents efa6a26 + 86b9692 commit ee3a701
Show file tree
Hide file tree
Showing 181 changed files with 4,045 additions and 2,125 deletions.
5 changes: 5 additions & 0 deletions .github/actions/spelling/expect.txt
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ barbie
BINDIR
blkid
bmarzins
Bsymbolic
cciss
CFLAGS
cgroups
Expand Down Expand Up @@ -59,6 +60,7 @@ EVPD
failback
failover
fds
fexceptions
FFFFFFFF
fge
followover
Expand Down Expand Up @@ -90,6 +92,7 @@ igroup
img
inotify
inttypes
ioctls
iscsi
isw
kpartx
Expand All @@ -102,6 +105,7 @@ libdevmapper
libdmmp
libedit
libjson
libmpathcmd
libmpathpersist
libmpathutil
libmpathvalid
Expand Down Expand Up @@ -205,6 +209,7 @@ sysfs
sysinit
tcp
terabytes
SYSDIR
TESTDEPS
testname
tgill
Expand Down
3 changes: 3 additions & 0 deletions .github/actions/spelling/patterns.txt
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
\bdmmp_pgs\b
\bdmmp_mpath_kdev_name_get\b
\bfast_io_fail_tmo\b
\blibmp_mapinfo\b
\bLimitRTPRIO=?\b
\bmax_fds\b
\bmissing_uev_wait_timeout\b
Expand Down Expand Up @@ -101,5 +102,7 @@
\bHBAs\b
\bSANtricity\b
\bVTrak\b
\bXSG1\b



68 changes: 56 additions & 12 deletions .github/workflows/foreign.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -36,20 +36,14 @@ jobs:
- name: checkout
uses: actions/checkout@v1
- name: build
run: make -j8 -Orecurse TESTDIR=/build/tests test-progs
run: make -j8 -Orecurse test-progs
- name: create binary archive
run: >
tar cfv binaries.tar
Makefile* config.mk
libmpathcmd/*.so* libmultipath/*.so* libmpathutil/*.so*
libmultipath/checkers/*.so libmultipath/prioritizers/*.so
libmultipath/foreign/*.so
tests/lib tests/*-test tests/Makefile tests/*.so*
run: make test-progs.tar
- name: upload binary archive
uses: actions/upload-artifact@v1
with:
name: cross-${{ matrix.os }}-${{ matrix.arch }}
path: binaries.tar
path: test-progs.tar

test:
runs-on: ubuntu-22.04
Expand All @@ -71,15 +65,65 @@ jobs:
with:
name: cross-${{ matrix.os }}-${{ matrix.arch }}
- name: unpack binary archive
run: tar xfv cross-${{ matrix.os }}-${{ matrix.arch }}/binaries.tar
run: tar xfv cross-${{ matrix.os }}-${{ matrix.arch }}/test-progs.tar
- name: enable foreign arch
uses: dbhi/qus/action@main
- name: run tests
uses: mosteo-actions/docker-run@v1
with:
image: ghcr.io/mwilck/multipath-run-debian-${{ matrix.os }}
guest-dir: /build
guest-dir: /__w/multipath-tools/multipath-tools
host-dir: ${{ github.workspace }}
command: -C tests
params: "--platform linux/${{ env.CONTAINER_ARCH }}"
params: >
--workdir /__w/multipath-tools/multipath-tools
--platform linux/${{ env.CONTAINER_ARCH }}
pull-params: "--platform linux/${{ env.CONTAINER_ARCH }}"

root-test:
runs-on: ubuntu-22.04
needs: cross-build
strategy:
fail-fast: false
matrix:
os: [bookworm, sid]
arch: [ppc64le, arm64, s390x]
steps:
- name: mpath
run: sudo modprobe dm_multipath
- name: brd
run: sudo modprobe brd rd_nr=1 rd_size=65536
- name: set container arch
run: echo CONTAINER_ARCH="${{ matrix.arch }}" >> $GITHUB_ENV
if: ${{ matrix.arch != 'armhf' }}
- name: set container arch
run: echo CONTAINER_ARCH="arm/v7" >> $GITHUB_ENV
if: ${{ matrix.arch == 'armhf' }}
- name: download binary archive
uses: actions/download-artifact@v1
with:
name: cross-${{ matrix.os }}-${{ matrix.arch }}
- name: unpack binary archive
run: tar xfv cross-${{ matrix.os }}-${{ matrix.arch }}/test-progs.tar
- name: enable foreign arch
uses: dbhi/qus/action@main
- name: run tests
uses: mosteo-actions/docker-run@v1
with:
image: ghcr.io/mwilck/multipath-run-debian-${{ matrix.os }}
guest-dir: /__w/multipath-tools/multipath-tools
host-dir: ${{ github.workspace }}
command: -C tests dmevents.out
params: >
--workdir /__w/multipath-tools/multipath-tools
--platform linux/${{ env.CONTAINER_ARCH }}
--privileged
-v /dev/ram0:/dev/ram0 -e DIO_TEST_DEV=/dev/ram0
pull-params: "--platform linux/${{ env.CONTAINER_ARCH }}"
id: root-test
continue-on-error: true
- name: show root test output
run: for o in tests/*.out; do echo "===== $o ====="; cat "$o"; done
- name: fail
run: /bin/false
if: ${{ steps.root-test.outcome == 'failure' }}
1 change: 1 addition & 0 deletions .github/workflows/multiarch.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ jobs:
- alpine
- debian-sid
- fedora-rawhide
- opensuse-tumbleweed
arch: [amd64, ppc64le, aarch64, s390x, 386, arm/v7]
exclude:
- os: fedora-rawhide
Expand Down
79 changes: 73 additions & 6 deletions .github/workflows/native.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -40,21 +40,88 @@ jobs:
- name: checkout
uses: actions/checkout@v1
- name: build and test
if: ${{ matrix.os != 'jessie' }}
run: make test
if: ${{ matrix.os != 'debian-jessie' }}
run: make -j -Orecurse test
- name: build and test (jessie)
# On jessie, we use libreadline 5 (no licensing issue)
if: ${{ matrix.os == 'jessie' }}
run: make -j -Orecurse READLINE=libreadline test
if: ${{ matrix.os == 'debian-jessie' }}
run: make -j -Orecurse READLINE=libreadline test

- name: set archive name
# Leap containers have cpio but not tar
run: echo ARCHIVE_TGT=test-progs.cpio >> $GITHUB_ENV
if: ${{ matrix.os == 'opensuse-leap' }}
- name: set archive name
run: echo ARCHIVE_TGT=test-progs.tar >> $GITHUB_ENV
if: ${{ matrix.os != 'opensuse-leap' }}
- name: create binary archive
run: make ${{ env.ARCHIVE_TGT }}
- name: upload binary archive
uses: actions/upload-artifact@v1
with:
name: native-${{ matrix.os }}
path: ${{ env.ARCHIVE_TGT }}

- name: clean
run: make clean
- name: clang
if: ${{ matrix.os != 'jessie' }}
if: ${{ matrix.os != 'debian-jessie' }}
env:
CC: clang
run: make -j -Orecurse test
- name: clang (jessie)
if: ${{ matrix.os == 'jessie' }}
if: ${{ matrix.os == 'debian-jessie' }}
env:
CC: clang
run: make READLINE=libreadline test

root-test:
runs-on: ubuntu-22.04
needs: stable
strategy:
fail-fast: false
matrix:
os:
- debian-jessie
- debian-buster
- debian-bullseye
- debian-bookworm
- fedora-40
- opensuse-leap
steps:
- name: mpath
run: sudo modprobe dm_multipath
- name: brd
run: sudo modprobe brd rd_nr=1 rd_size=65536

- name: checkout
uses: actions/checkout@v1

- name: download binary archive
uses: actions/download-artifact@v1
with:
name: native-${{ matrix.os }}
- name: unpack binary archive
run: cpio -idv < native-${{ matrix.os }}/test-progs.cpio
if: ${{ matrix.os == 'opensuse-leap' }}
- name: unpack binary archive
run: tar xfmv native-${{ matrix.os }}/test-progs.tar
if: ${{ matrix.os != 'opensuse-leap' }}

- name: run root tests
uses: mosteo-actions/docker-run@v1
with:
image: ghcr.io/mwilck/multipath-build-${{ matrix.os }}
guest-dir: /__w/multipath-tools/multipath-tools
host-dir: ${{ github.workspace }}
params: >
--workdir /__w/multipath-tools/multipath-tools --privileged
-v /dev/ram0:/dev/ram0 -e DIO_TEST_DEV=/dev/ram0
command: -C tests directio.out dmevents.out
id: root-test
continue-on-error: true
- name: show root test output
run: for o in tests/*.out; do echo "===== $o ====="; cat "$o"; done
- name: fail
run: /bin/false
if: ${{ steps.root-test.outcome == 'failure' }}
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,12 @@
*.gz
*.d
\#*
compile_commands.json
config.mk
cscope.files
cscope.out
kpartx/kpartx
kpartx/kpartx.rules
multipath/multipath
multipath/multipath.8
multipath/multipath.conf.5
Expand Down Expand Up @@ -40,6 +42,8 @@ libdmmp/test/libdmmp_speed_test
tests/*-test
tests/*.out
tests/*.vgr
tests/test-lib.o.wrap
tests/test-log.o.wrap
libmultipath/nvme-ioctl.c
libmultipath/nvme-ioctl.h
libmultipath/autoconfig.h
Expand Down
19 changes: 16 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,13 @@ LIB_BUILDDIRS += \
libdmmp
endif

BUILDDIRS := $(LIB_BUILDDIRS) \
PLUGIN_BUILDDIRS := \
libmultipath/prioritizers \
libmultipath/checkers \
libmultipath/foreign \

BUILDDIRS := $(LIB_BUILDDIRS) \
$(PLUGIN_BUILDDIRS) \
multipath \
multipathd \
mpathpersist \
Expand Down Expand Up @@ -83,7 +86,7 @@ abi-test: abi reference-abi $(wildcard abi/*.abi)
# Requires bear (https://github.com/rizsotto/Bear)
compile_commands.json: Makefile Makefile.inc $(BUILDDIRS:=/Makefile)
$(Q)$(MAKE) clean
$(Q)bear -- $(MAKE)
$(Q)bear -- $(MAKE) WARN_ONLY=1 test-progs || rm $@

libmpathutil libdmmp: libmpathcmd
libmultipath: libmpathutil
Expand All @@ -109,7 +112,7 @@ $(BUILDDIRS:=.uninstall):
clean:
@touch config.mk
$(Q)$(MAKE) $(BUILDDIRS:=.clean) tests.clean || true
$(Q)$(RM) -r abi abi.tar.gz abi-test compile_commands.json config.mk
$(Q)$(RM) -r abi abi.tar.gz abi-test config.mk

install: $(BUILDDIRS:=.install)
uninstall: $(BUILDDIRS:=.uninstall)
Expand All @@ -123,6 +126,16 @@ test: all
valgrind-test: all
@$(MAKE) -C tests valgrind

TEST-ARTIFACTS := config.mk Makefile.inc \
$(LIB_BUILDDIRS:%=%/*.so*) $(PLUGIN_BUILDDIRS:%=%/*.so) \
tests/Makefile tests/*.so* tests/lib/* tests/*-test

test-progs.cpio: test-progs
@printf "%s\\n" $(TEST-ARTIFACTS) | cpio -o -H crc >$@

test-progs.tar: test-progs
@tar cf $@ $(TEST-ARTIFACTS)

.PHONY: TAGS
TAGS:
@etags -a libmultipath/*.c
Expand Down
32 changes: 25 additions & 7 deletions Makefile.inc
Original file line number Diff line number Diff line change
Expand Up @@ -42,9 +42,11 @@ etc_prefix := $(prefix)
# Where to install systemd-related files. systemd is usually installed under /usr
# Note: systemd installations with "split-usr=true" use separate "prefixdir" and
# "rootprefixdir". Our systemd_prefix corresponds to "prefixdir".
# In this case, override only unitdir and libudevdir below to use
# systemd's "rootprefixdir" instead of $(systemd_prefix)
# In this case, override only unitdir, libudevdir and sys_execprefix below
# to use systemd's "rootprefixdir" instead of $(systemd_prefix)
systemd_prefix := /usr
# Prefix for binaries that are owned by other packages (including systemd)
sys_execprefix := /usr

# Make sure all prefix variables end in "/"
append-slash = $(1)$(if $(filter %/,$(1)),,/)
Expand All @@ -53,6 +55,7 @@ override exec_prefix := $(call append-slash,$(exec_prefix))
override usr_prefix := $(call append-slash,$(usr_prefix))
override etc_prefix := $(call append-slash,$(etc_prefix))
override systemd_prefix := $(call append-slash,$(systemd_prefix))
override sys_execprefix := $(call append-slash,$(sys_execprefix))

unitdir := $(systemd_prefix)lib/systemd/system
tmpfilesdir := $(systemd_prefix)lib/tmpfiles.d
Expand All @@ -74,6 +77,7 @@ runtimedir := $(if $(shell test -L /var/run -o ! -d /var/run && echo 1),/ru
devmapper_incdir := $(or $(shell $(PKG_CONFIG) --variable=includedir devmapper),/usr/include)
libudev_incdir := $(or $(shell $(PKG_CONFIG) --variable=includedir libudev),/usr/include)
kernel_incdir := /usr/include
sysdir_bin := $(sys_execprefix)bin

ifeq ($(V),)
Q := @
Expand All @@ -96,16 +100,23 @@ MODPROBE_UNIT := $(shell test "0$(SYSTEMD)" -lt 245 2>/dev/null || \
echo "modprobe@dm_multipath.service")

OPTFLAGS := -O2 -g $(STACKPROT) --param=ssp-buffer-size=4
WARNFLAGS := -Werror -Wall -Wextra -Wformat=2 $(WFORMATOVERFLOW) -Werror=implicit-int \
-Werror=implicit-function-declaration -Werror=format-security \
$(WNOCLOBBERED) -Werror=cast-qual $(ERROR_DISCARDED_QUALIFIERS) $(W_URCU_TYPE_LIMITS)

# Set WARN_ONLY=1 to avoid compilation erroring out due to warnings. Useful during development.
WARN_ONLY :=
ERROR := $(if $(WARN_ONLY),,error=)
WERROR := $(if $(WARN_ONLY),,-Werror)
WARNFLAGS := $(WERROR) -Wall -Wextra -Wformat=2 $(WFORMATOVERFLOW) -W$(ERROR)implicit-int \
-W$(ERROR)implicit-function-declaration -W$(ERROR)format-security \
$(WNOCLOBBERED) -W$(ERROR)cast-qual $(ERROR_DISCARDED_QUALIFIERS) $(W_URCU_TYPE_LIMITS)

CPPFLAGS := $(FORTIFY_OPT) $(CPPFLAGS) $(D_URCU_VERSION) \
-D_FILE_OFFSET_BITS=64 \
-DBIN_DIR=\"$(bindir)\" -DMULTIPATH_DIR=\"$(TGTDIR)$(plugindir)\" \
-DRUNTIME_DIR=\"$(runtimedir)\" -DCONFIG_DIR=\"$(TGTDIR)$(configdir)\" \
-DDEFAULT_CONFIGFILE=\"$(TGTDIR)$(configfile)\" -DSTATE_DIR=\"$(TGTDIR)$(statedir)\" \
-DEXTRAVERSION=\"$(EXTRAVERSION)\" -MMD -MP
CFLAGS := -std=gnu99 $(CFLAGS) $(OPTFLAGS) $(WARNFLAGS) -pipe
CFLAGS := -std=gnu99 $(CFLAGS) $(OPTFLAGS) $(WARNFLAGS) -pipe \
-fexceptions
BIN_CFLAGS := -fPIE -DPIE
LIB_CFLAGS := -fPIC
SHARED_FLAGS := -shared
Expand Down Expand Up @@ -149,4 +160,11 @@ NV_VERSION_SCRIPT = $(DEVLIB:%.so=%-nv.version)

%: %.in
@echo creating $@
$(Q)sed 's:@CONFIGFILE@:'$(TGTDIR)$(configfile)':g;s:@CONFIGDIR@:'$(TGTDIR)$(configdir)':g;s:@STATE_DIR@:'$(TGTDIR)$(statedir)':g;s:@RUNTIME_DIR@:'$(runtimedir)':g;s/@MODPROBE_UNIT@/'$(MODPROBE_UNIT)'/g;s:@BINDIR@:'$(bindir)':g' $< >$@
$(Q)sed -e 's:@CONFIGFILE@:'$(TGTDIR)$(configfile)':g' \
-e 's:@CONFIGDIR@:'$(TGTDIR)$(configdir)':g' \
-e 's:@STATE_DIR@:'$(TGTDIR)$(statedir)':g' \
-e 's:@BINDIR@:'$(TGTDIR)$(bindir)':g' \
-e 's:@SYSDIR_BIN@:'$(sysdir_bin)': g' \
-e 's:@RUNTIME_DIR@:'$(runtimedir)':g' \
-e 's/@MODPROBE_UNIT@/'$(MODPROBE_UNIT)'/g' \
$< >$@
Loading

0 comments on commit ee3a701

Please sign in to comment.