From 6d587c40bbfea281c49c904dc1cb26d790eb18a1 Mon Sep 17 00:00:00 2001 From: Cole Robinson Date: Mon, 20 Jun 2016 17:20:53 -0400 Subject: [PATCH] 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 --- virtManager/storagepool.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/virtManager/storagepool.py b/virtManager/storagepool.py index 26bd3c3f7..b920e6128 100644 --- a/virtManager/storagepool.py +++ b/virtManager/storagepool.py @@ -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()