libvirt get_host_capabilities() duplicates features
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
OpenStack Compute (nova) |
Fix Released
|
Undecided
|
Loganathan Parthipan |
Bug Description
get_host_
def get_host_
"""Returns an instance of config.
the capabilities of the host.
"""
if not self._caps:
xmlstr = self._conn.
if hasattr(libvirt, 'VIR_CONNECT_
return self._caps
The _caps.parse_str() is called in sequence for both capabilites and expand features. Since capabilities will have certain features in a VM, and these will be repeated again in the expand features, the _caps.host.
(nova)root@
Python 2.7.6 (default, Mar 22 2014, 22:59:38)
[GCC 4.8.2] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import libvirt
>>> conn = libvirt.
>>> from nova.virt.libvirt import config as vconfig
>>> caps = vconfig.
>>> xmlstr = conn.getCapabil
>>> caps.parse_
>>> features = conn.baselineCP
>>> caps.host.
>>> for f in caps.host.
... print f.name
...
hypervisor
popcnt
hypervisor
popcnt
pni
sse2
sse
fxsr
mmx
pat
cmov
pge
sep
apic
cx8
mce
pae
msr
tsc
pse
de
fpu
>>>
summary: |
- libvirt get_host_capabilities duplicates + libvirt get_host_capabilities duplicates features |
summary: |
- libvirt get_host_capabilities duplicates features + libvirt get_host_capabilities() duplicates features |
Changed in nova: | |
assignee: | nobody → Loganathan Parthipan (parthipan) |
tags: | added: libvirt |
tags: | added: compute |
Changed in nova: | |
milestone: | none → juno-1 |
status: | Fix Committed → Fix Released |
Changed in nova: | |
milestone: | juno-1 → 2014.2 |
I have bypassed it by adding 2 lines of code to driver.py
def get_host_ capabilities( self): LibvirtConfigCa ps representing getCapabilities ()
self. _caps = vconfig. LibvirtConfigCa ps()
self. _caps.parse_ str(xmlstr) BASELINE_ CPU_EXPAND_ FEATURES' ):
try:
features = self._conn. baselineCPU(
[self. _caps.host. cpu.to_ xml()],
libvirt. VIR_CONNECT_ BASELINE_ CPU_EXPAND_ FEATURES)
"""Returns an instance of config.
the capabilities of the host.
"""
if not self._caps:
xmlstr = self._conn.
if hasattr(libvirt, 'VIR_CONNECT_
return self._caps