opensvc / multipath-tools

Other
60 stars 48 forks source link

kpartx/devmapper.c: fix build errors caused by -Werror on unused variables #23

Closed trofi closed 2 years ago

mwilck commented 2 years ago

Looks good to me, but please submit to the dm-devel mailing list, adding at least mwilck at suse dot com and bmarzins at redhat dot com to CC.

Out of curiosity, you seem to be using a very old libdevmapper, as LIBDM_API_COOKIE has been supported since 2011. What distro is this? I'm not saying it's unsupported, but environments with such old libdm don't receive a lot of testing these days.

mwilck commented 2 years ago

@cvaroqui: I realize that I lack the permissions to approve running the github workflows on PRs like this (see "4 workflows awaiting approval" above). It might be useful to grant this permission to @bmarzins and myself.

trofi commented 2 years ago

Looks good to me, but please submit to the dm-devel mailing list, adding at least mwilck at suse dot com and bmarzins at redhat dot com to CC.

Sounds good. Sent both patches as:

Out of curiosity, you seem to be using a very old libdevmapper, as LIBDM_API_COOKIE has been supported since 2011. What distro is this? I'm not saying it's unsupported, but environments with such old libdm don't receive a lot of testing these days.

Oh, that's a good question! It's a NixOS with lvm2-2.03.14. The only build failure I saw was when I tried to build from git tree (packaged releases build fine). I debugged it locally and found that I did not apply the workaround my distribution does for releases:

    substituteInPlace libmultipath/Makefile \
      --replace /usr/include/libdevmapper.h ${lib.getDev lvm2}/include/libdevmapper.h

NixOS installs headers into package-private paths like /nix/store/...-lvm2-2.03.14-dev. That explains why feature detection fails. WDYT of using pkg-config to discover headers path?

$ pkg-config --variable=includedir devmapper
/nix/store/c30fr0ahpa285sjkjgiinc2rr68ysmid-lvm2-2.03.14-dev/include
mwilck commented 2 years ago

Would you provide a patch?

mwilck commented 2 years ago

Would you provide a patch?

... for using pkg-config, I meant.

trofi commented 2 years ago

Would you provide a patch?

Sure! Sent a few patches in this area as: https://listman.redhat.com/archives/dm-devel/2022-January/msg00034.html