From 53459cb0f650a9339ad1de6c79cad11d4c39cf0b Mon Sep 17 00:00:00 2001 From: Cole Robinson Date: Mon, 20 Jun 2016 16:40:33 -0400 Subject: [PATCH] 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. --- virtManager/connection.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/virtManager/connection.py b/virtManager/connection.py index 6be8031e3..31878c7a4 100644 --- a/virtManager/connection.py +++ b/virtManager/connection.py @@ -778,6 +778,13 @@ class vmmConnection(vmmGObject): name = pool.name() logging.debug("storage pool lifecycle event: storage=%s event=%s " "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) if obj: