storagepool: Don't refresh newly arriving pools

If they show up while a connection is 'active', it means they were
just defined/created, and thus a pool refresh is likely redundant
This commit is contained in:
Cole Robinson 2016-06-20 17:20:53 -04:00
parent 53459cb0f6
commit 6d587c40bb
1 changed files with 6 additions and 1 deletions

View File

@ -148,7 +148,12 @@ class vmmStoragePool(vmmLibvirtObject):
def _init_libvirt_state(self):
self.tick()
self.refresh(_do_refresh_xml=False)
if not self.conn.is_active():
# We only want to refresh a pool on initial conn startup,
# since the pools may be out of date. But if a storage pool
# shows up while the conn is connected, this means it was
# just 'defined' recently and doesn't need to be refreshed.
self.refresh(_do_refresh_xml=False)
for vol in self.get_volumes():
vol.init_libvirt_state()