summaryrefslogtreecommitdiffstats
path: root/nova/virt
diff options
context:
space:
mode:
authorJenkins <jenkins@review.openstack.org>2013-02-12 03:47:33 +0000
committerGerrit Code Review <review@openstack.org>2013-02-12 03:47:33 +0000
commit9bac8aa336d1b40b1bf4e026af72b6f31d2a23fc (patch)
tree5f6a9bd14357d0a28e0b435d1b33960db5e3014a /nova/virt
parentc27f0739509cc67966ca4d5674ed3f526a76ca60 (diff)
parentccd252d383be74ce33eadb019ac1a7958ae2824d (diff)
downloadnova-9bac8aa336d1b40b1bf4e026af72b6f31d2a23fc.tar.gz
nova-9bac8aa336d1b40b1bf4e026af72b6f31d2a23fc.tar.xz
nova-9bac8aa336d1b40b1bf4e026af72b6f31d2a23fc.zip
Merge "lxc: virDomainGetVcpus is not supported by driver"
Diffstat (limited to 'nova/virt')
-rwxr-xr-xnova/virt/libvirt/driver.py11
1 files changed, 4 insertions, 7 deletions
diff --git a/nova/virt/libvirt/driver.py b/nova/virt/libvirt/driver.py
index 485f661e5..5f19f0c18 100755
--- a/nova/virt/libvirt/driver.py
+++ b/nova/virt/libvirt/driver.py
@@ -2203,18 +2203,15 @@ class LibvirtDriver(driver.ComputeDriver):
"""
total = 0
+ if CONF.libvirt_type == 'lxc':
+ return total + 1
+
dom_ids = self.list_instance_ids()
for dom_id in dom_ids:
try:
dom = self._conn.lookupByID(dom_id)
vcpus = dom.vcpus()
- if vcpus is None:
- # dom.vcpus is not implemented for lxc, but returning 0 for
- # a used count is hardly useful for something measuring
- # usage
- total += 1
- else:
- total += len(vcpus[1])
+ total += len(vcpus[1])
except libvirt.libvirtError as err:
if err.get_error_code() == libvirt.VIR_ERR_NO_DOMAIN:
LOG.debug(_("List of domains returned by libVirt: %s")