mirror of
https://github.com/virt-manager/virt-manager.git
synced 2025-02-25 18:55:27 -06:00
connection: Remove clear_cache callback
It doesn't actually accomplish what we want for the virt-manager case, and cache_new_pool should cover our needs now
This commit is contained in:
parent
4792c7cb8e
commit
a9903ae0e0
@ -319,16 +319,6 @@ class vmmConnection(vmmGObject):
|
||||
self._wait_for_condition(compare_cb)
|
||||
self._backend.cb_cache_new_pool = cache_new_pool
|
||||
|
||||
def clear_cache(pools=False):
|
||||
if not pools:
|
||||
return
|
||||
|
||||
# This isn't synchronous, so any virtinst callers need to
|
||||
# take that into account.
|
||||
self.schedule_priority_tick(pollpool=True)
|
||||
|
||||
self._backend.cb_clear_cache = clear_cache
|
||||
|
||||
|
||||
########################
|
||||
# General data getters #
|
||||
@ -1007,7 +997,6 @@ class vmmConnection(vmmGObject):
|
||||
self._backend.cb_fetch_all_pools = None
|
||||
self._backend.cb_fetch_all_nodedevs = None
|
||||
self._backend.cb_fetch_all_vols = None
|
||||
self._backend.cb_clear_cache = None
|
||||
self._backend.cb_cache_new_pool = None
|
||||
|
||||
def open(self):
|
||||
|
@ -80,7 +80,6 @@ class VirtualConnection(object):
|
||||
self.cb_fetch_all_pools = None
|
||||
self.cb_fetch_all_vols = None
|
||||
self.cb_fetch_all_nodedevs = None
|
||||
self.cb_clear_cache = None
|
||||
self.cb_cache_new_pool = None
|
||||
|
||||
|
||||
@ -166,14 +165,6 @@ class VirtualConnection(object):
|
||||
_FETCH_KEY_VOLS = "vols"
|
||||
_FETCH_KEY_NODEDEVS = "nodedevs"
|
||||
|
||||
def clear_cache(self, pools=False):
|
||||
if self.cb_clear_cache:
|
||||
self.cb_clear_cache(pools=pools) # pylint: disable=not-callable
|
||||
return
|
||||
|
||||
if pools:
|
||||
self._fetch_cache.pop(self._FETCH_KEY_POOLS, None)
|
||||
|
||||
def _fetch_all_guests_raw(self):
|
||||
ignore, ignore, ret = pollhelpers.fetch_vms(
|
||||
self, {}, lambda obj, ignore: obj)
|
||||
|
@ -175,7 +175,6 @@ def manage_path(conn, path):
|
||||
poolxml.type = poolxml.TYPE_DIR
|
||||
poolxml.target_path = dirname
|
||||
pool = poolxml.install(build=False, create=True, autostart=True)
|
||||
conn.clear_cache(pools=True)
|
||||
|
||||
vol = _lookup_vol_by_basename(pool, path)
|
||||
return vol, pool
|
||||
|
@ -47,7 +47,6 @@ def _build_pool(conn, meter, path):
|
||||
# we probably don't have correct perms
|
||||
ret = poolbuild.install(meter=meter, create=True, build=False,
|
||||
autostart=True)
|
||||
conn.clear_cache(pools=True)
|
||||
return ret
|
||||
|
||||
|
||||
|
@ -226,7 +226,6 @@ class StoragePool(_StorageObject):
|
||||
defpool.name = name
|
||||
defpool.target_path = path
|
||||
defpool.install(build=True, create=True, autostart=True)
|
||||
conn.clear_cache(pools=True)
|
||||
return defpool
|
||||
except Exception as e:
|
||||
raise RuntimeError(
|
||||
|
Loading…
Reference in New Issue
Block a user