Blame 0010-lvm-Add-a-function-to-activate-LVs-in-shared-mode.patch

Vojtech Trefny bb32fd
From 6bdbafc79e5bcdf2087148c6caa88a6c50c1e94a Mon Sep 17 00:00:00 2001
Vojtech Trefny bb32fd
From: Vojtech Trefny <vtrefny@redhat.com>
Vojtech Trefny bb32fd
Date: Mon, 24 Apr 2023 11:57:18 +0200
Vojtech Trefny bb32fd
Subject: [PATCH] lvm: Add a function to activate LVs in shared mode
Vojtech Trefny bb32fd
Vojtech Trefny bb32fd
Needed by the new blivet feature to support shared LVM setups.
Vojtech Trefny bb32fd
---
Vojtech Trefny bb32fd
 src/lib/plugin_apis/lvm.api         | 16 +++++++++
Vojtech Trefny bb32fd
 src/plugins/lvm-dbus.c              | 51 ++++++++++++++++++++-------
Vojtech Trefny bb32fd
 src/plugins/lvm.c                   | 53 ++++++++++++++++++++++-------
Vojtech Trefny bb32fd
 src/plugins/lvm.h                   |  1 +
Vojtech Trefny bb32fd
 src/python/gi/overrides/BlockDev.py |  5 ++-
Vojtech Trefny bb32fd
 tests/lvm_dbus_tests.py             | 18 +++++++---
Vojtech Trefny bb32fd
 tests/lvm_test.py                   | 18 +++++++---
Vojtech Trefny bb32fd
 7 files changed, 124 insertions(+), 38 deletions(-)
Vojtech Trefny bb32fd
Vojtech Trefny bb32fd
diff --git a/src/lib/plugin_apis/lvm.api b/src/lib/plugin_apis/lvm.api
Vojtech Trefny bb32fd
index b8cde70b..640eee49 100644
Vojtech Trefny bb32fd
--- a/src/lib/plugin_apis/lvm.api
Vojtech Trefny bb32fd
+++ b/src/lib/plugin_apis/lvm.api
Vojtech Trefny bb32fd
@@ -1057,6 +1057,22 @@ gboolean bd_lvm_lvresize (const gchar *vg_name, const gchar *lv_name, guint64 si
Vojtech Trefny bb32fd
  */
Vojtech Trefny bb32fd
 gboolean bd_lvm_lvactivate (const gchar *vg_name, const gchar *lv_name, gboolean ignore_skip, const BDExtraArg **extra, GError **error);
Vojtech Trefny bb32fd
 
Vojtech Trefny bb32fd
+/**
Vojtech Trefny bb32fd
+ * bd_lvm_lvactivate_shared:
Vojtech Trefny bb32fd
+ * @vg_name: name of the VG containing the to-be-activated LV
Vojtech Trefny bb32fd
+ * @lv_name: name of the to-be-activated LV
Vojtech Trefny bb32fd
+ * @ignore_skip: whether to ignore the skip flag or not
Vojtech Trefny bb32fd
+ * @shared: whether to activate the LV in shared mode
Vojtech Trefny bb32fd
+ * @extra: (allow-none) (array zero-terminated=1): extra options for the LV activation
Vojtech Trefny bb32fd
+ *                                                 (just passed to LVM as is)
Vojtech Trefny bb32fd
+ * @error: (out): place to store error (if any)
Vojtech Trefny bb32fd
+ *
Vojtech Trefny bb32fd
+ * Returns: whether the @vg_name/@lv_name LV was successfully activated or not
Vojtech Trefny bb32fd
+ *
Vojtech Trefny bb32fd
+ * Tech category: %BD_LVM_TECH_BASIC-%BD_LVM_TECH_MODE_MODIFY
Vojtech Trefny bb32fd
+ */
Vojtech Trefny bb32fd
+gboolean bd_lvm_lvactivate_shared (const gchar *vg_name, const gchar *lv_name, gboolean ignore_skip, gboolean shared, const BDExtraArg **extra, GError **error);
Vojtech Trefny bb32fd
+
Vojtech Trefny bb32fd
 /**
Vojtech Trefny bb32fd
  * bd_lvm_lvdeactivate:
Vojtech Trefny bb32fd
  * @vg_name: name of the VG containing the to-be-deactivated LV
Vojtech Trefny bb32fd
diff --git a/src/plugins/lvm-dbus.c b/src/plugins/lvm-dbus.c
Vojtech Trefny bb32fd
index 28f3bb25..46e09833 100644
Vojtech Trefny bb32fd
--- a/src/plugins/lvm-dbus.c
Vojtech Trefny bb32fd
+++ b/src/plugins/lvm-dbus.c
Vojtech Trefny bb32fd
@@ -2163,6 +2163,27 @@ gboolean bd_lvm_lvresize (const gchar *vg_name, const gchar *lv_name, guint64 si
Vojtech Trefny bb32fd
     return (*error == NULL);
Vojtech Trefny bb32fd
 }
Vojtech Trefny bb32fd
 
Vojtech Trefny bb32fd
+static gboolean _lvm_lvactivate (const gchar *vg_name, const gchar *lv_name, gboolean ignore_skip, gboolean shared, const BDExtraArg **extra, GError **error) {
Vojtech Trefny bb32fd
+    GVariant *params = NULL;
Vojtech Trefny bb32fd
+    GVariantBuilder builder;
Vojtech Trefny bb32fd
+    GVariant *extra_params = NULL;
Vojtech Trefny bb32fd
+
Vojtech Trefny bb32fd
+    if (shared)
Vojtech Trefny bb32fd
+        params = g_variant_new ("(t)", (guint64) 1 << 6);
Vojtech Trefny bb32fd
+    else
Vojtech Trefny bb32fd
+        params = g_variant_new ("(t)", (guint64) 0);
Vojtech Trefny bb32fd
+
Vojtech Trefny bb32fd
+    if (ignore_skip) {
Vojtech Trefny bb32fd
+        g_variant_builder_init (&builder, G_VARIANT_TYPE_DICTIONARY);
Vojtech Trefny bb32fd
+        g_variant_builder_add (&builder, "{sv}", "-K", g_variant_new ("s", ""));
Vojtech Trefny bb32fd
+        extra_params = g_variant_builder_end (&builder);
Vojtech Trefny bb32fd
+        g_variant_builder_clear (&builder);
Vojtech Trefny bb32fd
+    }
Vojtech Trefny bb32fd
+    call_lv_method_sync (vg_name, lv_name, "Activate", params, extra_params, extra, TRUE, error);
Vojtech Trefny bb32fd
+
Vojtech Trefny bb32fd
+    return (*error == NULL);
Vojtech Trefny bb32fd
+}
Vojtech Trefny bb32fd
+
Vojtech Trefny bb32fd
 /**
Vojtech Trefny bb32fd
  * bd_lvm_lvactivate:
Vojtech Trefny bb32fd
  * @vg_name: name of the VG containing the to-be-activated LV
Vojtech Trefny bb32fd
@@ -2177,19 +2198,25 @@ gboolean bd_lvm_lvresize (const gchar *vg_name, const gchar *lv_name, guint64 si
Vojtech Trefny bb32fd
  * Tech category: %BD_LVM_TECH_BASIC-%BD_LVM_TECH_MODE_MODIFY
Vojtech Trefny bb32fd
  */
Vojtech Trefny bb32fd
 gboolean bd_lvm_lvactivate (const gchar *vg_name, const gchar *lv_name, gboolean ignore_skip, const BDExtraArg **extra, GError **error) {
Vojtech Trefny bb32fd
-    GVariant *params = g_variant_new ("(t)", (guint64) 0);
Vojtech Trefny bb32fd
-    GVariantBuilder builder;
Vojtech Trefny bb32fd
-    GVariant *extra_params = NULL;
Vojtech Trefny bb32fd
-
Vojtech Trefny bb32fd
-    if (ignore_skip) {
Vojtech Trefny bb32fd
-        g_variant_builder_init (&builder, G_VARIANT_TYPE_DICTIONARY);
Vojtech Trefny bb32fd
-        g_variant_builder_add (&builder, "{sv}", "-K", g_variant_new ("s", ""));
Vojtech Trefny bb32fd
-        extra_params = g_variant_builder_end (&builder);
Vojtech Trefny bb32fd
-        g_variant_builder_clear (&builder);
Vojtech Trefny bb32fd
-    }
Vojtech Trefny bb32fd
-    call_lv_method_sync (vg_name, lv_name, "Activate", params, extra_params, extra, TRUE, error);
Vojtech Trefny bb32fd
+    return _lvm_lvactivate (vg_name, lv_name, ignore_skip, FALSE, extra, error);
Vojtech Trefny bb32fd
+}
Vojtech Trefny bb32fd
 
Vojtech Trefny bb32fd
-    return (*error == NULL);
Vojtech Trefny bb32fd
+/**
Vojtech Trefny bb32fd
+ * bd_lvm_lvactivate_shared:
Vojtech Trefny bb32fd
+ * @vg_name: name of the VG containing the to-be-activated LV
Vojtech Trefny bb32fd
+ * @lv_name: name of the to-be-activated LV
Vojtech Trefny bb32fd
+ * @ignore_skip: whether to ignore the skip flag or not
Vojtech Trefny bb32fd
+ * @shared: whether to activate the LV in shared mode
Vojtech Trefny bb32fd
+ * @extra: (allow-none) (array zero-terminated=1): extra options for the LV activation
Vojtech Trefny bb32fd
+ *                                                 (just passed to LVM as is)
Vojtech Trefny bb32fd
+ * @error: (out): place to store error (if any)
Vojtech Trefny bb32fd
+ *
Vojtech Trefny bb32fd
+ * Returns: whether the @vg_name/@lv_name LV was successfully activated or not
Vojtech Trefny bb32fd
+ *
Vojtech Trefny bb32fd
+ * Tech category: %BD_LVM_TECH_BASIC-%BD_LVM_TECH_MODE_MODIFY
Vojtech Trefny bb32fd
+ */
Vojtech Trefny bb32fd
+gboolean bd_lvm_lvactivate_shared (const gchar *vg_name, const gchar *lv_name, gboolean ignore_skip, gboolean shared, const BDExtraArg **extra, GError **error) {
Vojtech Trefny bb32fd
+    return _lvm_lvactivate (vg_name, lv_name, ignore_skip, shared, extra, error);
Vojtech Trefny bb32fd
 }
Vojtech Trefny bb32fd
 
Vojtech Trefny bb32fd
 /**
Vojtech Trefny bb32fd
diff --git a/src/plugins/lvm.c b/src/plugins/lvm.c
Vojtech Trefny bb32fd
index f1e2941b..0db3bf4a 100644
Vojtech Trefny bb32fd
--- a/src/plugins/lvm.c
Vojtech Trefny bb32fd
+++ b/src/plugins/lvm.c
Vojtech Trefny bb32fd
@@ -1644,6 +1644,28 @@ gboolean bd_lvm_lvresize (const gchar *vg_name, const gchar *lv_name, guint64 si
Vojtech Trefny bb32fd
     return success;
Vojtech Trefny bb32fd
 }
Vojtech Trefny bb32fd
 
Vojtech Trefny bb32fd
+static gboolean _lvm_lvactivate (const gchar *vg_name, const gchar *lv_name, gboolean ignore_skip, gboolean shared, const BDExtraArg **extra, GError **error) {
Vojtech Trefny bb32fd
+    const gchar *args[5] = {"lvchange", NULL, NULL, NULL, NULL};
Vojtech Trefny bb32fd
+    guint8 next_arg = 2;
Vojtech Trefny bb32fd
+    gboolean success = FALSE;
Vojtech Trefny bb32fd
+
Vojtech Trefny bb32fd
+    if (shared)
Vojtech Trefny bb32fd
+        args[1] = "-asy";
Vojtech Trefny bb32fd
+    else
Vojtech Trefny bb32fd
+        args[1] = "-ay";
Vojtech Trefny bb32fd
+
Vojtech Trefny bb32fd
+    if (ignore_skip) {
Vojtech Trefny bb32fd
+        args[next_arg] = "-K";
Vojtech Trefny bb32fd
+        next_arg++;
Vojtech Trefny bb32fd
+    }
Vojtech Trefny bb32fd
+    args[next_arg] = g_strdup_printf ("%s/%s", vg_name, lv_name);
Vojtech Trefny bb32fd
+
Vojtech Trefny bb32fd
+    success = call_lvm_and_report_error (args, extra, TRUE, error);
Vojtech Trefny bb32fd
+    g_free ((gchar *) args[next_arg]);
Vojtech Trefny bb32fd
+
Vojtech Trefny bb32fd
+    return success;
Vojtech Trefny bb32fd
+}
Vojtech Trefny bb32fd
+
Vojtech Trefny bb32fd
 /**
Vojtech Trefny bb32fd
  * bd_lvm_lvactivate:
Vojtech Trefny bb32fd
  * @vg_name: name of the VG containing the to-be-activated LV
Vojtech Trefny bb32fd
@@ -1658,20 +1680,25 @@ gboolean bd_lvm_lvresize (const gchar *vg_name, const gchar *lv_name, guint64 si
Vojtech Trefny bb32fd
  * Tech category: %BD_LVM_TECH_BASIC-%BD_LVM_TECH_MODE_MODIFY
Vojtech Trefny bb32fd
  */
Vojtech Trefny bb32fd
 gboolean bd_lvm_lvactivate (const gchar *vg_name, const gchar *lv_name, gboolean ignore_skip, const BDExtraArg **extra, GError **error) {
Vojtech Trefny bb32fd
-    const gchar *args[5] = {"lvchange", "-ay", NULL, NULL, NULL};
Vojtech Trefny bb32fd
-    guint8 next_arg = 2;
Vojtech Trefny bb32fd
-    gboolean success = FALSE;
Vojtech Trefny bb32fd
-
Vojtech Trefny bb32fd
-    if (ignore_skip) {
Vojtech Trefny bb32fd
-        args[next_arg] = "-K";
Vojtech Trefny bb32fd
-        next_arg++;
Vojtech Trefny bb32fd
-    }
Vojtech Trefny bb32fd
-    args[next_arg] = g_strdup_printf ("%s/%s", vg_name, lv_name);
Vojtech Trefny bb32fd
-
Vojtech Trefny bb32fd
-    success = call_lvm_and_report_error (args, extra, TRUE, error);
Vojtech Trefny bb32fd
-    g_free ((gchar *) args[next_arg]);
Vojtech Trefny bb32fd
+    return _lvm_lvactivate (vg_name, lv_name, ignore_skip, FALSE, extra, error);
Vojtech Trefny bb32fd
+}
Vojtech Trefny bb32fd
 
Vojtech Trefny bb32fd
-    return success;
Vojtech Trefny bb32fd
+/**
Vojtech Trefny bb32fd
+ * bd_lvm_lvactivate_shared:
Vojtech Trefny bb32fd
+ * @vg_name: name of the VG containing the to-be-activated LV
Vojtech Trefny bb32fd
+ * @lv_name: name of the to-be-activated LV
Vojtech Trefny bb32fd
+ * @ignore_skip: whether to ignore the skip flag or not
Vojtech Trefny bb32fd
+ * @shared: whether to activate the LV in shared mode
Vojtech Trefny bb32fd
+ * @extra: (allow-none) (array zero-terminated=1): extra options for the LV activation
Vojtech Trefny bb32fd
+ *                                                 (just passed to LVM as is)
Vojtech Trefny bb32fd
+ * @error: (out): place to store error (if any)
Vojtech Trefny bb32fd
+ *
Vojtech Trefny bb32fd
+ * Returns: whether the @vg_name/@lv_name LV was successfully activated or not
Vojtech Trefny bb32fd
+ *
Vojtech Trefny bb32fd
+ * Tech category: %BD_LVM_TECH_BASIC-%BD_LVM_TECH_MODE_MODIFY
Vojtech Trefny bb32fd
+ */
Vojtech Trefny bb32fd
+gboolean bd_lvm_lvactivate_shared (const gchar *vg_name, const gchar *lv_name, gboolean ignore_skip, gboolean shared, const BDExtraArg **extra, GError **error) {
Vojtech Trefny bb32fd
+    return _lvm_lvactivate (vg_name, lv_name, ignore_skip, shared, extra, error);
Vojtech Trefny bb32fd
 }
Vojtech Trefny bb32fd
 
Vojtech Trefny bb32fd
 /**
Vojtech Trefny bb32fd
diff --git a/src/plugins/lvm.h b/src/plugins/lvm.h
Vojtech Trefny bb32fd
index fabf091f..c85c043d 100644
Vojtech Trefny bb32fd
--- a/src/plugins/lvm.h
Vojtech Trefny bb32fd
+++ b/src/plugins/lvm.h
Vojtech Trefny bb32fd
@@ -277,6 +277,7 @@ gboolean bd_lvm_lvremove (const gchar *vg_name, const gchar *lv_name, gboolean f
Vojtech Trefny bb32fd
 gboolean bd_lvm_lvrename (const gchar *vg_name, const gchar *lv_name, const gchar *new_name, const BDExtraArg **extra, GError **error);
Vojtech Trefny bb32fd
 gboolean bd_lvm_lvresize (const gchar *vg_name, const gchar *lv_name, guint64 size, const BDExtraArg **extra, GError **error);
Vojtech Trefny bb32fd
 gboolean bd_lvm_lvactivate (const gchar *vg_name, const gchar *lv_name, gboolean ignore_skip, const BDExtraArg **extra, GError **error);
Vojtech Trefny bb32fd
+gboolean bd_lvm_lvactivate_shared (const gchar *vg_name, const gchar *lv_name, gboolean ignore_skip, gboolean shared, const BDExtraArg **extra, GError **error);
Vojtech Trefny bb32fd
 gboolean bd_lvm_lvdeactivate (const gchar *vg_name, const gchar *lv_name, const BDExtraArg **extra, GError **error);
Vojtech Trefny bb32fd
 gboolean bd_lvm_lvsnapshotcreate (const gchar *vg_name, const gchar *origin_name, const gchar *snapshot_name, guint64 size, const BDExtraArg **extra, GError **error);
Vojtech Trefny bb32fd
 gboolean bd_lvm_lvsnapshotmerge (const gchar *vg_name, const gchar *snapshot_name, const BDExtraArg **extra, GError **error);
Vojtech Trefny bb32fd
diff --git a/src/python/gi/overrides/BlockDev.py b/src/python/gi/overrides/BlockDev.py
Vojtech Trefny bb32fd
index 795e0de4..3e074260 100644
Vojtech Trefny bb32fd
--- a/src/python/gi/overrides/BlockDev.py
Vojtech Trefny bb32fd
+++ b/src/python/gi/overrides/BlockDev.py
Vojtech Trefny bb32fd
@@ -605,11 +605,10 @@ def lvm_lvresize(vg_name, lv_name, size, extra=None, **kwargs):
Vojtech Trefny bb32fd
     return _lvm_lvresize(vg_name, lv_name, size, extra)
Vojtech Trefny bb32fd
 __all__.append("lvm_lvresize")
Vojtech Trefny bb32fd
 
Vojtech Trefny bb32fd
-_lvm_lvactivate = BlockDev.lvm_lvactivate
Vojtech Trefny bb32fd
 @override(BlockDev.lvm_lvactivate)
Vojtech Trefny bb32fd
-def lvm_lvactivate(vg_name, lv_name, ignore_skip=False, extra=None, **kwargs):
Vojtech Trefny bb32fd
+def lvm_lvactivate(vg_name, lv_name, ignore_skip=False, shared=False, extra=None, **kwargs):
Vojtech Trefny bb32fd
     extra = _get_extra(extra, kwargs)
Vojtech Trefny bb32fd
-    return _lvm_lvactivate(vg_name, lv_name, ignore_skip, extra)
Vojtech Trefny bb32fd
+    return BlockDev.lvm_lvactivate_shared(vg_name, lv_name, ignore_skip, shared, extra)
Vojtech Trefny bb32fd
 __all__.append("lvm_lvactivate")
Vojtech Trefny bb32fd
 
Vojtech Trefny bb32fd
 _lvm_lvdeactivate = BlockDev.lvm_lvdeactivate
Vojtech Trefny bb32fd
diff --git a/tests/lvm_dbus_tests.py b/tests/lvm_dbus_tests.py
Vojtech Trefny bb32fd
index fc12b55d..a821636e 100644
Vojtech Trefny bb32fd
--- a/tests/lvm_dbus_tests.py
Vojtech Trefny bb32fd
+++ b/tests/lvm_dbus_tests.py
Vojtech Trefny bb32fd
@@ -873,15 +873,15 @@ class LvmTestLVactivateDeactivate(LvmPVVGLVTestCase):
Vojtech Trefny bb32fd
         self.assertTrue(succ)
Vojtech Trefny bb32fd
 
Vojtech Trefny bb32fd
         with self.assertRaises(GLib.GError):
Vojtech Trefny bb32fd
-            BlockDev.lvm_lvactivate("nonexistingVG", "testLV", True, None)
Vojtech Trefny bb32fd
+            BlockDev.lvm_lvactivate("nonexistingVG", "testLV", True)
Vojtech Trefny bb32fd
 
Vojtech Trefny bb32fd
         with self.assertRaises(GLib.GError):
Vojtech Trefny bb32fd
-            BlockDev.lvm_lvactivate("testVG", "nonexistingLV", True, None)
Vojtech Trefny bb32fd
+            BlockDev.lvm_lvactivate("testVG", "nonexistingLV", True)
Vojtech Trefny bb32fd
 
Vojtech Trefny bb32fd
         with self.assertRaises(GLib.GError):
Vojtech Trefny bb32fd
-            BlockDev.lvm_lvactivate("nonexistingVG", "nonexistingLV", True, None)
Vojtech Trefny bb32fd
+            BlockDev.lvm_lvactivate("nonexistingVG", "nonexistingLV", True)
Vojtech Trefny bb32fd
 
Vojtech Trefny bb32fd
-        succ = BlockDev.lvm_lvactivate("testVG", "testLV", True, None)
Vojtech Trefny bb32fd
+        succ = BlockDev.lvm_lvactivate("testVG", "testLV", True)
Vojtech Trefny bb32fd
         self.assertTrue(succ)
Vojtech Trefny bb32fd
 
Vojtech Trefny bb32fd
         with self.assertRaises(GLib.GError):
Vojtech Trefny bb32fd
@@ -896,7 +896,15 @@ class LvmTestLVactivateDeactivate(LvmPVVGLVTestCase):
Vojtech Trefny bb32fd
         succ = BlockDev.lvm_lvdeactivate("testVG", "testLV", None)
Vojtech Trefny bb32fd
         self.assertTrue(succ)
Vojtech Trefny bb32fd
 
Vojtech Trefny bb32fd
-        succ = BlockDev.lvm_lvactivate("testVG", "testLV", True, None)
Vojtech Trefny bb32fd
+        succ = BlockDev.lvm_lvactivate("testVG", "testLV", True)
Vojtech Trefny bb32fd
+        self.assertTrue(succ)
Vojtech Trefny bb32fd
+
Vojtech Trefny bb32fd
+        succ = BlockDev.lvm_lvdeactivate("testVG", "testLV", None)
Vojtech Trefny bb32fd
+        self.assertTrue(succ)
Vojtech Trefny bb32fd
+
Vojtech Trefny bb32fd
+        # try activating in shared mode, unfortunately no way to check whether it really
Vojtech Trefny bb32fd
+        # works or not
Vojtech Trefny bb32fd
+        succ = BlockDev.lvm_lvactivate("testVG", "testLV", True, True)
Vojtech Trefny bb32fd
         self.assertTrue(succ)
Vojtech Trefny bb32fd
 
Vojtech Trefny bb32fd
         succ = BlockDev.lvm_lvdeactivate("testVG", "testLV", None)
Vojtech Trefny bb32fd
diff --git a/tests/lvm_test.py b/tests/lvm_test.py
Vojtech Trefny bb32fd
index 7ede4b59..63f43afb 100644
Vojtech Trefny bb32fd
--- a/tests/lvm_test.py
Vojtech Trefny bb32fd
+++ b/tests/lvm_test.py
Vojtech Trefny bb32fd
@@ -807,15 +807,15 @@ class LvmTestLVactivateDeactivate(LvmPVVGLVTestCase):
Vojtech Trefny bb32fd
         self.assertTrue(succ)
Vojtech Trefny bb32fd
 
Vojtech Trefny bb32fd
         with self.assertRaises(GLib.GError):
Vojtech Trefny bb32fd
-            BlockDev.lvm_lvactivate("nonexistingVG", "testLV", True, None)
Vojtech Trefny bb32fd
+            BlockDev.lvm_lvactivate("nonexistingVG", "testLV", True)
Vojtech Trefny bb32fd
 
Vojtech Trefny bb32fd
         with self.assertRaises(GLib.GError):
Vojtech Trefny bb32fd
-            BlockDev.lvm_lvactivate("testVG", "nonexistingLV", True, None)
Vojtech Trefny bb32fd
+            BlockDev.lvm_lvactivate("testVG", "nonexistingLV", True)
Vojtech Trefny bb32fd
 
Vojtech Trefny bb32fd
         with self.assertRaises(GLib.GError):
Vojtech Trefny bb32fd
-            BlockDev.lvm_lvactivate("nonexistingVG", "nonexistingLV", True, None)
Vojtech Trefny bb32fd
+            BlockDev.lvm_lvactivate("nonexistingVG", "nonexistingLV", True)
Vojtech Trefny bb32fd
 
Vojtech Trefny bb32fd
-        succ = BlockDev.lvm_lvactivate("testVG", "testLV", True, None)
Vojtech Trefny bb32fd
+        succ = BlockDev.lvm_lvactivate("testVG", "testLV", True)
Vojtech Trefny bb32fd
         self.assertTrue(succ)
Vojtech Trefny bb32fd
 
Vojtech Trefny bb32fd
         with self.assertRaises(GLib.GError):
Vojtech Trefny bb32fd
@@ -830,7 +830,15 @@ class LvmTestLVactivateDeactivate(LvmPVVGLVTestCase):
Vojtech Trefny bb32fd
         succ = BlockDev.lvm_lvdeactivate("testVG", "testLV", None)
Vojtech Trefny bb32fd
         self.assertTrue(succ)
Vojtech Trefny bb32fd
 
Vojtech Trefny bb32fd
-        succ = BlockDev.lvm_lvactivate("testVG", "testLV", True, None)
Vojtech Trefny bb32fd
+        succ = BlockDev.lvm_lvactivate("testVG", "testLV", True)
Vojtech Trefny bb32fd
+        self.assertTrue(succ)
Vojtech Trefny bb32fd
+
Vojtech Trefny bb32fd
+        succ = BlockDev.lvm_lvdeactivate("testVG", "testLV", None)
Vojtech Trefny bb32fd
+        self.assertTrue(succ)
Vojtech Trefny bb32fd
+
Vojtech Trefny bb32fd
+        # try activating in shared mode, unfortunately no way to check whether it really
Vojtech Trefny bb32fd
+        # works or not
Vojtech Trefny bb32fd
+        succ = BlockDev.lvm_lvactivate("testVG", "testLV", True, True)
Vojtech Trefny bb32fd
         self.assertTrue(succ)
Vojtech Trefny bb32fd
 
Vojtech Trefny bb32fd
         succ = BlockDev.lvm_lvdeactivate("testVG", "testLV", None)
Vojtech Trefny bb32fd
-- 
Vojtech Trefny bb32fd
2.41.0
Vojtech Trefny bb32fd