summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJenkins <jenkins@review.openstack.org>2012-10-24 00:33:29 +0000
committerGerrit Code Review <review@openstack.org>2012-10-24 00:33:29 +0000
commita3d27d189258e2684581bf5e6a1961332e6d44bb (patch)
tree214c710917df60765367e01ece418ca668fdf9d0
parent7c36755c03b16f8f5fec8080bc313c615e06c58f (diff)
parent0daebe727246eef501c54adaa678995467e3060b (diff)
Merge "Add virt driver capabilities definition"
-rw-r--r--nova/compute/manager.py2
-rw-r--r--nova/virt/driver.py4
-rw-r--r--nova/virt/libvirt/driver.py4
3 files changed, 10 insertions, 0 deletions
diff --git a/nova/compute/manager.py b/nova/compute/manager.py
index f598ccb39..515737992 100644
--- a/nova/compute/manager.py
+++ b/nova/compute/manager.py
@@ -2970,6 +2970,8 @@ class ComputeManager(manager.SchedulerDependentManager):
def _run_image_cache_manager_pass(self, context):
"""Run a single pass of the image cache manager."""
+ if not self.driver.capabilities["has_imagecache"]:
+ return
if FLAGS.image_cache_manager_interval == 0:
return
diff --git a/nova/virt/driver.py b/nova/virt/driver.py
index 59fac115f..8a7c39fa8 100644
--- a/nova/virt/driver.py
+++ b/nova/virt/driver.py
@@ -88,6 +88,10 @@ class ComputeDriver(object):
"""
+ capabilities = {
+ "has_imagecache": False,
+ }
+
def init_host(self, host):
"""Initialize anything that is necessary for the driver to function,
including catching up with currently running VM's on the given host."""
diff --git a/nova/virt/libvirt/driver.py b/nova/virt/libvirt/driver.py
index e704a52ec..049203539 100644
--- a/nova/virt/libvirt/driver.py
+++ b/nova/virt/libvirt/driver.py
@@ -258,6 +258,10 @@ def _get_eph_disk(ephemeral):
class LibvirtDriver(driver.ComputeDriver):
+ capabilities = {
+ "has_imagecache": True,
+ }
+
def __init__(self, read_only=False):
super(LibvirtDriver, self).__init__()