Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
scsi/qemu-pr-helper: Drop support for 'old' libmultipath API
Commit 1b0578f ("qemu-pr-helper: Fix build on CentOS 7") added
code to probe for 'old' libmultipath API on CentOS 7. However since
merge commit 8c345b3 (June 2021) we don't build/test CentOS 7 as
it felt out of our list of supported distrib versions. Therefore we
can safely remove the 'old' API check (mostly reverting commit
1b0578f, except the code got converted to meson in commit
6ec0e15 "meson: move libmpathpersist test").

Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Message-Id: <20230605174146.87440-2-philmd@linaro.org>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
  • Loading branch information
philmd authored and bonzini committed Jun 6, 2023
1 parent 6da5f22 commit 6b40847
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 21 deletions.
19 changes: 2 additions & 17 deletions meson.build
Expand Up @@ -1092,9 +1092,8 @@ endif

mpathlibs = [libudev]
mpathpersist = not_found
mpathpersist_new_api = false
if targetos == 'linux' and have_tools and get_option('mpath').allowed()
mpath_test_source_new = '''
mpath_test_source = '''
#include <libudev.h>
#include <mpath_persist.h>
unsigned mpath_mx_alloc_len = 1024;
Expand All @@ -1111,16 +1110,6 @@ if targetos == 'linux' and have_tools and get_option('mpath').allowed()
multipath_conf = mpath_lib_init();
return 0;
}'''
mpath_test_source_old = '''
#include <libudev.h>
#include <mpath_persist.h>
unsigned mpath_mx_alloc_len = 1024;
int logsink;
int main(void) {
struct udev *udev = udev_new();
mpath_lib_init(udev);
return 0;
}'''
libmpathpersist = cc.find_library('mpathpersist',
required: get_option('mpath'))
if libmpathpersist.found()
Expand All @@ -1139,10 +1128,7 @@ if targetos == 'linux' and have_tools and get_option('mpath').allowed()
endforeach
if mpathlibs.length() == 0
msg = 'Dependencies missing for libmpathpersist'
elif cc.links(mpath_test_source_new, dependencies: mpathlibs)
mpathpersist = declare_dependency(dependencies: mpathlibs)
mpathpersist_new_api = true
elif cc.links(mpath_test_source_old, dependencies: mpathlibs)
elif cc.links(mpath_test_source, dependencies: mpathlibs)
mpathpersist = declare_dependency(dependencies: mpathlibs)
else
msg = 'Cannot detect libmpathpersist API'
Expand Down Expand Up @@ -2094,7 +2080,6 @@ config_host_data.set('CONFIG_GCOV', get_option('b_coverage'))
config_host_data.set('CONFIG_LIBUDEV', libudev.found())
config_host_data.set('CONFIG_LZO', lzo.found())
config_host_data.set('CONFIG_MPATH', mpathpersist.found())
config_host_data.set('CONFIG_MPATH_NEW_API', mpathpersist_new_api)
config_host_data.set('CONFIG_BLKIO', blkio.found())
if blkio.found()
config_host_data.set('CONFIG_BLKIO_VHOST_VDPA_FD',
Expand Down
4 changes: 0 additions & 4 deletions scsi/qemu-pr-helper.c
Expand Up @@ -280,11 +280,7 @@ void put_multipath_config(struct config *conf)
static void multipath_pr_init(void)
{
udev = udev_new();
#ifdef CONFIG_MPATH_NEW_API
multipath_conf = mpath_lib_init();
#else
mpath_lib_init(udev);
#endif
}

static int is_mpath(int fd)
Expand Down

0 comments on commit 6b40847

Please sign in to comment.