From 64083c0d1f42e40d8a15a8a138184599bbcd94bb Mon Sep 17 00:00:00 2001 From: Vojtech Trefny Date: Fri, 31 Jan 2025 12:39:03 +0100 Subject: [PATCH 1/2] lvm: Require higher version of LVM for lvm.conf parsing The --valuesonly option we use is not available on LVM < 2.03.17 --- src/plugins/lvm-dbus.c | 2 +- src/plugins/lvm.c | 5 ++++- tests/skip.yml | 6 ++++++ 3 files changed, 11 insertions(+), 2 deletions(-) diff --git a/src/plugins/lvm-dbus.c b/src/plugins/lvm-dbus.c index a9c93f89..01ba5c44 100644 --- a/src/plugins/lvm-dbus.c +++ b/src/plugins/lvm-dbus.c @@ -300,7 +300,7 @@ static GMutex deps_check_lock; static const UtilDep deps[DEPS_LAST] = { {"lvm", LVM_MIN_VERSION, "version", "LVM version:\\s+([\\d\\.]+)"}, {"lvmdevices", NULL, NULL, NULL}, - {"lvmconfig", NULL, NULL, NULL}, + {"lvmconfig", "2.03.17", "--version", "LVM version:\\s+([\\d\\.]+)"}, }; #define DBUS_DEPS_LVMDBUSD 0 diff --git a/src/plugins/lvm.c b/src/plugins/lvm.c index a572fdd2..a3b5fba9 100644 --- a/src/plugins/lvm.c +++ b/src/plugins/lvm.c @@ -307,11 +307,14 @@ static GMutex deps_check_lock; #define DEPS_LVM_MASK (1 << DEPS_LVM) #define DEPS_LVMDEVICES 1 #define DEPS_LVMDEVICES_MASK (1 << DEPS_LVMDEVICES) -#define DEPS_LAST 2 +#define DEPS_LVMCONFIG 2 +#define DEPS_LVMCONFIG_MASK (1 << DEPS_LVMCONFIG) +#define DEPS_LAST 3 static const UtilDep deps[DEPS_LAST] = { {"lvm", LVM_MIN_VERSION, "version", "LVM version:\\s+([\\d\\.]+)"}, {"lvmdevices", NULL, NULL, NULL}, + {"lvmconfig", "2.03.17", "--version", "LVM version:\\s+([\\d\\.]+)"}, }; #define FEATURES_VDO 0 diff --git a/tests/skip.yml b/tests/skip.yml index cf0a9580..2a522d0f 100644 --- a/tests/skip.yml +++ b/tests/skip.yml @@ -59,3 +59,9 @@ - test: lvm_dbus_tests.LvmTestPartialLVs skip_on: - reason: "LVM DBus doesn't support LV repair yet" + +- test: (lvm_test|lvm_dbus_tests).LvmNoDevTestCase.test_lvm_config + skip_on: + - distro: "debian" + version: "12" + reason: "LVM >= 2.03.17 needed for LVM config parsing with --valuesonly" From caa40c78172fa4038404361527b40028db833c44 Mon Sep 17 00:00:00 2001 From: Vojtech Trefny Date: Fri, 31 Jan 2025 14:27:44 +0100 Subject: [PATCH 2/2] lvm: Fix check for BD_LVM_TECH_CONFIG availability in CLI plugin --- src/plugins/lvm.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/plugins/lvm.c b/src/plugins/lvm.c index a3b5fba9..f050e343 100644 --- a/src/plugins/lvm.c +++ b/src/plugins/lvm.c @@ -399,6 +399,8 @@ gboolean bd_lvm_is_tech_avail (BDLVMTech tech, guint64 mode, GError **error) { check_deps (&avail_deps, DEPS_LVM_MASK, deps, DEPS_LAST, &deps_check_lock, error); case BD_LVM_TECH_DEVICES: return check_deps (&avail_deps, DEPS_LVMDEVICES_MASK, deps, DEPS_LAST, &deps_check_lock, error); + case BD_LVM_TECH_CONFIG: + return check_deps (&avail_deps, DEPS_LVMCONFIG_MASK, deps, DEPS_LAST, &deps_check_lock, error); default: /* everything is supported by this implementation of the plugin */ return check_deps (&avail_deps, DEPS_LVM_MASK, deps, DEPS_LAST, &deps_check_lock, error);