mirror of
https://github.com/virt-manager/virt-manager.git
synced 2025-01-21 18:03:58 +03:00
Don't 'refresh' pool every time we want to list volumes.
This commit is contained in:
parent
b93fc2adc1
commit
8438a49599
@ -120,12 +120,14 @@ class vmmStoragePool(gobject.GObject):
|
||||
def get_volume(self, uuid):
|
||||
return self._volumes[uuid]
|
||||
|
||||
def refresh(self):
|
||||
self.pool.refresh(0)
|
||||
|
||||
def update_volumes(self):
|
||||
if not self.is_active():
|
||||
self._volumes = {}
|
||||
return
|
||||
|
||||
self.pool.refresh(0)
|
||||
vols = self.pool.listVolumes()
|
||||
new_vol_list = {}
|
||||
|
||||
@ -139,6 +141,7 @@ class vmmStoragePool(gobject.GObject):
|
||||
volname)
|
||||
self._volumes = new_vol_list
|
||||
|
||||
|
||||
def _prettyify(self, val):
|
||||
if val > (1024*1024*1024):
|
||||
return "%2.2f GB" % (val/(1024.0*1024.0*1024.0))
|
||||
|
Loading…
x
Reference in New Issue
Block a user