mirror of
https://github.com/virt-manager/virt-manager.git
synced 2025-02-25 18:55:27 -06: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):
|
def get_volume(self, uuid):
|
||||||
return self._volumes[uuid]
|
return self._volumes[uuid]
|
||||||
|
|
||||||
|
def refresh(self):
|
||||||
|
self.pool.refresh(0)
|
||||||
|
|
||||||
def update_volumes(self):
|
def update_volumes(self):
|
||||||
if not self.is_active():
|
if not self.is_active():
|
||||||
self._volumes = {}
|
self._volumes = {}
|
||||||
return
|
return
|
||||||
|
|
||||||
self.pool.refresh(0)
|
|
||||||
vols = self.pool.listVolumes()
|
vols = self.pool.listVolumes()
|
||||||
new_vol_list = {}
|
new_vol_list = {}
|
||||||
|
|
||||||
@ -139,6 +141,7 @@ class vmmStoragePool(gobject.GObject):
|
|||||||
volname)
|
volname)
|
||||||
self._volumes = new_vol_list
|
self._volumes = new_vol_list
|
||||||
|
|
||||||
|
|
||||||
def _prettyify(self, val):
|
def _prettyify(self, val):
|
||||||
if val > (1024*1024*1024):
|
if val > (1024*1024*1024):
|
||||||
return "%2.2f GB" % (val/(1024.0*1024.0*1024.0))
|
return "%2.2f GB" % (val/(1024.0*1024.0*1024.0))
|
||||||
|
Loading…
Reference in New Issue
Block a user