Gitweb: https://sourceware.org/git/?p=lvm2.git;a=commitdiff;h=f91df163e21b283e652bc…
Commit: f91df163e21b283e652bc830b5af49a7bb3cf3fb
Parent: f961311436bda50b219f6d2909d8602e37148611
Author: Tony Asleson <tasleson(a)redhat.com>
AuthorDate: Mon Oct 14 14:31:27 2019 -0500
Committer: Tony Asleson <tasleson(a)redhat.com>
CommitterDate: Wed Oct 30 10:38:40 2019 -0500
lvmdbustest.py: Improve concurrent test handling
Filter out LVs too, so that we can run more than 1 instance of the
unit test at the same time.
---
test/dbus/lvmdbustest.py | 12 ++++++++++--
1 files changed, 10 insertions(+), 2 deletions(-)
diff --git a/test/dbus/lvmdbustest.py b/test/dbus/lvmdbustest.py
index 64a126a..711b247 100755
--- a/test/dbus/lvmdbustest.py
+++ b/test/dbus/lvmdbustest.py
@@ -90,6 +90,9 @@ def _root_pv_name(res, pv_name):
if v.Vg.Name == vg_name:
pv = ClientProxy(bus, v.Vg.Pvs[0], interfaces=(PV_INT, ))
return _root_pv_name(res, pv.Pv.Name)
+def _prune_lvs(res, interface, vg_object_path):
+ lvs = [lv for lv in res[interface] if lv.LvCommon.Vg == vg_object_path]
+ res[interface] = lvs
def _prune(res, pv_filter):
@@ -106,11 +109,16 @@ def _prune(res, pv_filter):
vg_list = []
for v in res[VG_INT]:
- # Only need to validate one of the PVs is in the selection set
if v.Vg.Pvs[0] in pv_lookup:
vg_list.append(v)
+ for interface in \
+ [LV_INT, THINPOOL_INT, LV_COMMON_INT,
+ CACHE_POOL_INT, CACHE_LV_INT, VDOPOOL_INT]:
+ _prune_lvs(res, interface, v.object_path)
+
res[VG_INT] = vg_list
+
return res
@@ -134,7 +142,7 @@ def get_objects():
rc[interface].append(proxy)
# At this point we have a full population of everything, we now need to
- # prune the PV list and the VG list if we are using a sub selection
+ # prune the the objects if we are filtering PVs with a sub selection.
return _prune(rc, pv_device_list), bus
Gitweb: https://sourceware.org/git/?p=lvm2.git;a=commitdiff;h=4dcb36aba4160ffe9ae90…
Commit: 4dcb36aba4160ffe9ae90c93642e717e813e4779
Parent: f56b21ae2c7667d69c050653d527f9071ef83ad5
Author: Tony Asleson <tasleson(a)redhat.com>
AuthorDate: Thu Oct 10 16:53:10 2019 -0500
Committer: Tony Asleson <tasleson(a)redhat.com>
CommitterDate: Wed Oct 30 10:38:40 2019 -0500
lvmdbusd: Fix model inconsistency when LV loses interface
When a LV loses an interface it ends up getting removed and recreated.
This happens after the VGs have been processed and updated. Thus when
this happens we need to re-check the VGs.
---
daemons/lvmdbusd/fetch.py | 17 ++++++++++++++++-
1 files changed, 16 insertions(+), 1 deletions(-)
diff --git a/daemons/lvmdbusd/fetch.py b/daemons/lvmdbusd/fetch.py
index e8f3521..b7eb8c8 100644
--- a/daemons/lvmdbusd/fetch.py
+++ b/daemons/lvmdbusd/fetch.py
@@ -29,11 +29,26 @@ def _main_thread_load(refresh=True, emit_signal=True):
refresh=refresh,
emit_signal=emit_signal,
cache_refresh=False)[1]
- num_total_changes += load_lvs(
+
+ lv_changes = load_lvs(
refresh=refresh,
emit_signal=emit_signal,
cache_refresh=False)[1]
+ num_total_changes += lv_changes
+
+ # When the LVs change it can cause another change in the VGs which is
+ # missed if we don't scan through the VGs again. We could achieve this
+ # the other way and re-scan the LVs, but in general there are more LVs than
+ # VGs, thus this should be more efficient. This happens when a LV interface
+ # changes causing the dbus object representing it to be removed and
+ # recreated.
+ if refresh and lv_changes > 0:
+ num_total_changes += load_vgs(
+ refresh=refresh,
+ emit_signal=emit_signal,
+ cache_refresh=False)[1]
+
return num_total_changes