mirror of
https://github.com/virt-manager/virt-manager.git
synced 2025-02-25 18:55:27 -06:00
conn: Don't process any pool REFRESHED events during conn startup
When new pool objects appear, we call refresh() on them, to ensure we have the latest data (in case manual changes were made to the storage pool directory behind libvirt's back, which is quite common). However with the storage event support, this results in lots of REFRESHED signals during initial connection startup, which kick off redundant object polling. Avoid storage REFRESHED events if they come in before the connection is finished starting up to skip this redundant polling.
This commit is contained in:
parent
6a740ff91c
commit
53459cb0f6
@ -778,6 +778,13 @@ class vmmConnection(vmmGObject):
|
|||||||
name = pool.name()
|
name = pool.name()
|
||||||
logging.debug("storage pool lifecycle event: storage=%s event=%s "
|
logging.debug("storage pool lifecycle event: storage=%s event=%s "
|
||||||
"reason=%s", name, event, reason)
|
"reason=%s", name, event, reason)
|
||||||
|
|
||||||
|
if (not self.is_active() and
|
||||||
|
event == getattr(libvirt, "VIR_STORAGE_POOL_EVENT_REFRESHED", 4)):
|
||||||
|
# We refresh() pools during connection startup, and this spams
|
||||||
|
# the logs, so skip it.
|
||||||
|
return
|
||||||
|
|
||||||
obj = self.get_pool(name)
|
obj = self.get_pool(name)
|
||||||
|
|
||||||
if obj:
|
if obj:
|
||||||
|
Loading…
Reference in New Issue
Block a user