Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

multipath-tools 0.10.0 #94

Merged
merged 145 commits into from
Aug 27, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
145 commits
Select commit Hold shift + click to select a range
16c6ce9
multipathd: fix flush check in flush_map()
bmarzins Jun 5, 2024
d092638
libmultipath: check for not PATH_UP in detect_alua
bmarzins Jun 5, 2024
ca957f2
multipath-tools: Makefile.inc: compile with -fexceptions
bmarzins Jun 5, 2024
7f45a02
multipathd: free alias if cli_add_map() is cancelled
bmarzins Jun 5, 2024
282ea9f
multipath.conf.5: fix the description of prio_args for path_latency prio
Jun 12, 2024
b70feeb
multipath-tools: add older HUAWEI models
xosevp Jul 13, 2024
014e314
multipath-tools: add more tags XSG1 vendors
xosevp Jul 13, 2024
7e4145a
GitHub workflows: multiarch: add openSUSE Tumbleweed
mwilck Jun 25, 2024
606dc52
multipath-tools CI: more fixes for arm/v7
mwilck Jun 25, 2024
2c7867a
multipath-tools CI: fix dmevents test for Debian Sid, arm/v7
mwilck Jul 8, 2024
8cf033b
create-config.mk: use printf instead of /bin/echo
mwilck Jun 6, 2024
8ec2bc1
multipathd.service.in: use @BINDIR@ instead of /sbin
mwilck Jun 6, 2024
d3a4478
Makefile.inc: replace @BINDIR@ with $(TGTDIR)/$(bindir)
mwilck Jun 6, 2024
8c38475
kpartx.rules: use @BINDIR@ to locate kpartx
mwilck Jun 6, 2024
4e276a4
multipath-tools: Remove hard-coded paths to executables
mwilck Jun 11, 2024
01fc1df
multipath-tools: compile_commands.json fixes
mwilck Jun 27, 2024
8021c44
multipath-tools: .gitignore: ignore o.wrap files for CI helpers
mwilck Jul 2, 2024
3099a3b
libmultipath: remove unused includes in devmapper.h
mwilck Jun 27, 2024
9350966
libmultipath: use DM_DEVICE_INFO in dm_mapname()
mwilck Jun 27, 2024
d00281f
multipath-tools: don't call dm_task_no_open_count()
mwilck Jun 27, 2024
1d00f4a
libmpathutil: export cleanup_udev_device()
mwilck Jul 5, 2024
344855e
libmpathutil: add cleanup_vector()
mwilck Jul 5, 2024
ff31fdd
libmultipath: add cleanup helpers for struct multipath
mwilck Jul 5, 2024
ad5c3cb
libmultipath: add cleanup_dm_task(), and use it in devmapper.c
mwilck Jun 29, 2024
55a57a2
libmultipath: rename dm_type()->dm_type_match() and use symbolic values
mwilck Jul 11, 2024
6dacf30
libmultipath: Use symbolic return values for dm_is_mpath()
mwilck Jul 11, 2024
fd2a873
libmultipath: add libmp_mapinfo()
mwilck Jun 28, 2024
28d9f8c
libmultipath tests: add tests for libmp_mapinfo()
mwilck Jul 8, 2024
5578f6b
libmultipath: implement dm_get_info() and dm_map_present() with new API
mwilck Jun 29, 2024
38f0e10
libmultipath: remove dm_get_prefixed_uuid()
mwilck Jun 28, 2024
cd8cf07
libmultipath: is_mpath_part(): improve parsing
mwilck Jul 1, 2024
b5dae69
libmultipath: rename dm_get_uuid() -> dm_get_wwid()
mwilck Jul 1, 2024
a46ef2c
libmultipath: improve dm_get_wwid() return value logic
mwilck Jul 1, 2024
5689835
libmultipath: reimplement dm_map_name() with new API
mwilck Jun 28, 2024
39a12eb
libmultipath: reimplement dm_map_present_by_uuid()
mwilck Jun 27, 2024
1fd6cd9
libmultipath: reimplement dm_get_opencount() with new API
mwilck Jun 27, 2024
d24d718
libmpathpersist: skip redundant dm_map_present() call
mwilck Jun 27, 2024
8f7f69d
libmultipath: implement dm_is_mpath() with new API
mwilck Jul 2, 2024
e708b67
libmultipath: implement dm_get_multipath() with new API
mwilck Jul 2, 2024
5ab6b2e
libmultipath: use libmp_mapinfo() in _dm_flush_map()
mwilck Jul 5, 2024
d30092b
libmultipath: add is_mpath_uuid() helper
mwilck Jul 5, 2024
69e99b4
libmultipath: add is_mpath_part_uuid() helper
mwilck Jul 5, 2024
47158f9
libmultipath: add dmp_errstr() helper
mwilck Jul 5, 2024
a50fd29
libmultipath: use libmp_mapinfo() in do_foreach_partmaps()
mwilck Jul 5, 2024
10794d1
libmultipath: use libmp_pathinfo() in update_multipath_table()
mwilck Jul 5, 2024
cff3e3e
libmultipath: update mpp->dmi in update_multipath_table()
mwilck Jul 5, 2024
4dabf74
libmultipath: drop extra call to dm_map_present() in domap()
mwilck Jul 5, 2024
407f09e
libmultipath: split off update_multipath_table__()
mwilck Jul 5, 2024
8bed80d
multipath: implement check_usable_paths() with libmp_pathinfo()
mwilck Jul 5, 2024
0e2fd75
multipathd: implement add_map_without_path() with libmp_mapinfo()
mwilck Jul 5, 2024
bf3a4ad
libmultipath: simplify dm_get_maps()
mwilck Jul 8, 2024
8e77186
libmpathpersist: use libmp_mapinfo() in mpath_get_map()
mwilck Jul 8, 2024
3a26e27
libmpathpersist: use mpp->alias in do_mpath_persistent_reserve_out()
mwilck Jul 8, 2024
f1e1c22
libmultipath: fix deferred_remove logic in remove_partmap()
mwilck Jul 12, 2024
59425ee
libmultipath: Move UUID check into libmp_pathinfo__()
mwilck Jul 12, 2024
3940e1a
libmultipath: don't call do_foreach_partmaps() recursively
mwilck Jul 12, 2024
01c2759
multipath-tools tests: fix directio test with real device
mwilck Jul 11, 2024
fd4ccb6
Makefile: add targets for test-progs.cpio and test-progs.tar
mwilck Jul 10, 2024
d1af020
multipath-tools tests: Fix .SECONDARY in Makefile for GNU make 4.4
mwilck Jul 10, 2024
ca083e0
GitHub workflows: native.yaml: fix os name for Debian Jessie
mwilck Jul 18, 2024
1be2f9a
GitHub workflows: native.yml: run root tests
mwilck Jul 10, 2024
5cb497d
GitHub workflows: foreign.yaml: run dmevents test as root
mwilck Jul 16, 2024
70a2680
GitHub workflows: spelling fixes
mwilck Jul 18, 2024
c531404
fixup "libmultipath tests: add tests for libmp_mapinfo()"
mwilck Jul 18, 2024
d07c0fb
multipath-tools: remove duplicate headers
xosevp Jul 17, 2024
e0d873c
libmultipath.version: remove dm_get_wwid()
mwilck Jul 18, 2024
787e00d
Update README.md
mwilck Jul 18, 2024
50f4990
libmpathcmd: check len parameter in mpath_recv_reply_data()
mwilck Jul 18, 2024
77340e7
multipath-tools: use signed loop variable in vector_foreach_slot
mwilck Jul 18, 2024
a2a16ad
libmpathutil: avoid size_t underflow in strchop()
mwilck Jul 18, 2024
7668f4b
fixup "libmultipath: use libmp_pathinfo() in update_multipath_table()"
mwilck Jul 18, 2024
db1e726
libmpathpersist: set mpp->mpe before selecting reservation_key
bmarzins Jul 24, 2024
e1ae74f
libmultipath: rename dm_map_present_by_wwid() and add outputs
bmarzins Jul 17, 2024
4c8acd6
multipathd: make cli_add_map() handle adding maps by WWID correctly
bmarzins Jul 17, 2024
4c8310e
multipathd: remove checker restart optimization
bmarzins Jul 17, 2024
a89243e
multipathd: refactor path state getting code into a helper
bmarzins Jul 17, 2024
bc4f0b9
multipathd: handle uninitialized paths in new function
bmarzins Jul 17, 2024
cb7ae99
multipathd: check paths immediately after failing udev initialization
bmarzins Jul 17, 2024
8e4961e
multipathd: set pp->tick = max_checkint in handle_uninitialized_path
bmarzins Jul 17, 2024
828e745
multipathd: return 0 from check_path() if that path wasn't checked
bmarzins Jul 17, 2024
d5813f0
multipathd: reorder path state checks
bmarzins Jul 17, 2024
d0bf35f
multipathd: adjust when mpp is synced with the kernel
bmarzins Jul 17, 2024
6840a41
multipathd: resync map after setup_map in ev_remove_path
bmarzins Jul 17, 2024
5fdd2c8
multipathd: resync map after setup_map in resize_map
bmarzins Jul 17, 2024
9ae56ba
multipathd: always resync map in reload_and_sync_map
bmarzins Jul 17, 2024
c8e3a87
multipathd: correctly handle paths removed for a wwid change
bmarzins Jul 17, 2024
dd265e5
multipathd: handle changed wwid when adding partial path
bmarzins Jul 17, 2024
26dc96a
multipathd: don't read conf->checkint twice in check_path
bmarzins Jul 17, 2024
c0ba04d
multipathd: make multipath devices manage their path check times
bmarzins Jul 19, 2024
66acfb6
multipathd: factor out actual path checking loop from checkerloop
bmarzins Jul 17, 2024
7133ff2
multipathd: check paths in order by mpp
bmarzins Jul 17, 2024
4a664f8
multipathd: clean up the correct wwid in check_path_wwid_change
bmarzins Jul 17, 2024
4160502
multipath-tools: update NEWS.md
mwilck Jul 18, 2024
de74fbd
multipathd: show pending reconfigs in 'show daemon' output
bmarzins Aug 6, 2024
a634209
libmultipath: fix ontap prioritizer snprintf limits
bmarzins Aug 7, 2024
4cf36e7
multipath-tools tests: make alias.test succeed with increased verbosity
mwilck Aug 8, 2024
87f48fa
libmpathutil: avoid extra memory allocation in print_strbuf()
mwilck Aug 8, 2024
2115c3c
libmpathutil: rename strlcat and strlcpy
mwilck Aug 7, 2024
6b1f41f
libmpathutil.version: remove strlcpy and strlcat, and LIBMULTIPATH se…
mwilck Aug 7, 2024
4186b6c
libmpathutil: fix __attribute typo in log_pthread.c
mwilck Aug 7, 2024
2e19972
libmultipath: devmapper.c: rename __DR_UNUSED__, and fix __attribute …
mwilck Aug 7, 2024
e60bf21
multipathd: fix __attribute typo
mwilck Aug 7, 2024
216de53
multipath-tools: use common convention for "header file included" macros
mwilck Aug 7, 2024
f00dbc3
libmpathcmd: rename __mpath_connect() to mpath_connect__()
mwilck Aug 7, 2024
999ee16
libmpathutil: rename _MAX_CMD_LEN
mwilck Aug 7, 2024
dd9be76
libmpathutil: rename __append_strbuf_str() and __get_strbuf_buf()
mwilck Aug 7, 2024
005570b
libmpathutil: rename _log_bitfield_overflow()
mwilck Aug 8, 2024
0a64696
libmpathutil: rename _install_keyword() to install_keyword__()
mwilck Aug 8, 2024
346a0a0
libmultipath: rename _NVME_LIB_C
mwilck Aug 7, 2024
5f36d98
libmultipath: checkers.h: fix __CHECKER_FIRST_MSG in comment
mwilck Aug 7, 2024
88f101d
libmultipath: rename identifiers with leading underscores in devmapper.h
mwilck Aug 7, 2024
4926789
libmultipath: rename identifiers with leading underscores in discovery.h
mwilck Aug 7, 2024
901330c
libmultipath: rename __snprint_config()
mwilck Aug 7, 2024
323c506
libmultipath: rename __unlock()
mwilck Aug 7, 2024
d6d0dd2
libmultipath: rename __sysfs_attr_get_value()
mwilck Aug 7, 2024
aafcf62
libmultipath: rename __snprint_foreign_topology()
mwilck Aug 7, 2024
848d5ed
libmultipath: rename macros with double underscores in propsel.c
mwilck Aug 7, 2024
528f00c
libmultipath: rename enum values with double underscores in structs.h
mwilck Aug 7, 2024
8eed2f7
libmultipath: rename macros starting with underscore
mwilck Aug 7, 2024
26980be
libmultipath: rename __internal_config variable
mwilck Aug 7, 2024
2f02476
libmultipath: rename _dm_flush_map() to dm_flush_map__()
mwilck Aug 8, 2024
dd91940
libmultipath: foreign: rename _check() to check__()
mwilck Aug 8, 2024
8fd343f
libmultipath: rename _cleanup_foreign()
mwilck Aug 8, 2024
a471102
libmultipath: rename _init_config()
mwilck Aug 8, 2024
579bc65
libmultipath: rename symbols starting with underscore in print.h
mwilck Aug 8, 2024
73bce14
libmultipath: remove dead code in pgpolicies.h
mwilck Aug 7, 2024
dc97e65
libmultipath: remove struct and union names in cciss.h
mwilck Aug 7, 2024
b958d96
libmpathpersist: rename functions with double leading underscore
mwilck Aug 7, 2024
49a0d21
libdmmp: rename macros starting with _DMMP
mwilck Aug 7, 2024
f9e7f3e
libdmmp: rename enum values and variables starting with _DMMP_
mwilck Aug 7, 2024
7df0129
libdmmp: rename non-static functions starting with underscore
mwilck Aug 8, 2024
dd350c4
multipathd: rename symbols with double leading underscore
mwilck Aug 7, 2024
c065b90
multipath-tools tests: rename functions with double underscores
mwilck Aug 7, 2024
950d746
kpartx: rename macros with leading underscores
mwilck Aug 7, 2024
3757ed6
libmpathutil: rename struct _vector to vector_s
mwilck Aug 8, 2024
563ad90
libmultipath: don't define __user
mwilck Aug 7, 2024
9794e12
multipath-tools: add more info about the tur checker to the man page
xosevp Aug 12, 2024
0802e9d
multipath: display the correct configuration when dumping config
Aug 13, 2024
31861b7
libmpathutil: removed duplicate check for subsection devices
Aug 13, 2024
a583dcd
libmpathcmd: reinstate ABI 1.0.0
mwilck Aug 12, 2024
ced5e53
libmpathpersist: reinstate ABI 2.1.0
mwilck Aug 12, 2024
730059e
multipath-tools: update info about path_grouping_policy in the man page
xosevp Aug 15, 2024
5721ade
libmultipath, libmpathutil: explicitly annotate {get,put}_multipath_c…
0n-s Jun 10, 2024
9d90510
Updated NEWS.md
mwilck Aug 15, 2024
86b9692
libmultipath: bump version to 0.10.0
mwilck Aug 15, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading