summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTony Asleson <tasleson@redhat.com>2019-10-10 16:53:10 -0500
committerTony Asleson <tasleson@redhat.com>2019-10-30 10:38:40 -0500
commit4dcb36aba4160ffe9ae90c93642e717e813e4779 (patch)
tree55c9ba73da12a7b5258eb443a6c6e089e398c220
parentf56b21ae2c7667d69c050653d527f9071ef83ad5 (diff)
downloadlvm2-4dcb36aba4160ffe9ae90c93642e717e813e4779.tar.gz
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.
-rw-r--r--daemons/lvmdbusd/fetch.py17
1 files changed, 16 insertions, 1 deletions
diff --git a/daemons/lvmdbusd/fetch.py b/daemons/lvmdbusd/fetch.py
index e8f3521ac..b7eb8c83a 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