diskbackend: If pool not running, start it

Nowadays we depend on the pool existing and running, so better to get
an error up front if pool startup will fail
This commit is contained in:
Cole Robinson 2014-05-31 16:29:29 -04:00
parent 9c4c1e84aa
commit d6f063d0b8

View File

@ -86,9 +86,9 @@ def check_if_path_managed(conn, path):
if not vol:
pool = StoragePool.lookup_pool_by_path(conn, os.path.dirname(path))
# Is pool running?
# Ensure pool is running
if pool and pool.info()[0] != libvirt.VIR_STORAGE_POOL_RUNNING:
pool = None
pool.start()
# Attempt to lookup path as a storage volume
if pool and not vol: