mirror of
https://github.com/virt-manager/virt-manager.git
synced 2024-12-23 17:34:21 +03:00
storage: Fix updating UI when volume deleted (bz 1279940)
We in fact weren't updating the cached XML when pool.refresh() was called.
This commit is contained in:
parent
ba8080db3f
commit
0bf6124a28
@ -146,7 +146,7 @@ class vmmStoragePool(vmmLibvirtObject):
|
||||
|
||||
def _init_libvirt_state(self):
|
||||
self.tick()
|
||||
self.refresh(skip_xml_refresh=True)
|
||||
self.refresh(_do_refresh_xml=False)
|
||||
for vol in self.get_volumes():
|
||||
vol.init_libvirt_state()
|
||||
|
||||
@ -173,16 +173,16 @@ class vmmStoragePool(vmmLibvirtObject):
|
||||
self._backend.undefine()
|
||||
self._backend = None
|
||||
|
||||
def refresh(self, skip_xml_refresh=False):
|
||||
def refresh(self, _do_refresh_xml=True):
|
||||
"""
|
||||
:param skip_xml_refresh: Only used by init_libvirt_state to avoid
|
||||
double XML updating
|
||||
:param _do_refresh_xml: We want this by default. It's only skipped
|
||||
to avoid double updating XML via init_libvirt_state
|
||||
"""
|
||||
if not self.is_active():
|
||||
return
|
||||
|
||||
self._backend.refresh(0)
|
||||
if skip_xml_refresh:
|
||||
if _do_refresh_xml:
|
||||
self.ensure_latest_xml()
|
||||
self._update_volumes(force=True)
|
||||
self.idle_emit("refreshed")
|
||||
|
Loading…
Reference in New Issue
Block a user