connection: Handle nodedev polling too

And cleanup up a bunch of nodedev functions as a result
This commit is contained in:
Cole Robinson
2014-09-20 11:30:24 -04:00
parent 8cd4958a19
commit dd67c48233
6 changed files with 82 additions and 63 deletions

View File

@@ -79,11 +79,15 @@ def openconn(uri):
_conn_cache[uri]["vms"] = conn._fetch_all_guests_cached()
_conn_cache[uri]["pools"] = conn._fetch_all_pools_cached()
_conn_cache[uri]["vols"] = conn._fetch_all_vols_cached()
_conn_cache[uri]["nodedevs"] = conn._fetch_all_nodedevs_cached()
cache = _conn_cache[uri].copy()
def cb_fetch_all_guests():
return cache["vms"]
def cb_fetch_all_nodedevs():
return cache["nodedevs"]
def cb_fetch_all_pools():
if "pools" not in cache:
cache["pools"] = conn._fetch_all_pools_cached()
@@ -102,6 +106,7 @@ def openconn(uri):
conn.cb_fetch_all_guests = cb_fetch_all_guests
conn.cb_fetch_all_pools = cb_fetch_all_pools
conn.cb_fetch_all_vols = cb_fetch_all_vols
conn.cb_fetch_all_nodedevs = cb_fetch_all_nodedevs
conn.cb_clear_cache = cb_clear_cache
return conn