def _get_host_capabilities(self):
    'Returns an instance of config.LibvirtConfigCaps representing\n           the capabilities of the host.\n        '
    if (not self._caps):
        xmlstr = self._conn.getCapabilities()
        self._caps = vconfig.LibvirtConfigCaps()
        self._caps.parse_str(xmlstr)
        if hasattr(libvirt, 'VIR_CONNECT_BASELINE_CPU_EXPAND_FEATURES'):
            try:
                features = self._conn.baselineCPU([self._caps.host.cpu.to_xml()], libvirt.VIR_CONNECT_BASELINE_CPU_EXPAND_FEATURES)
                if (features and (features != (- 1))):
                    cpu = vconfig.LibvirtConfigCPU()
                    cpu.parse_str(features)
                    self._caps.host.cpu.features = cpu.features
            except libvirt.libvirtError as ex:
                error_code = ex.get_error_code()
                if (error_code == libvirt.VIR_ERR_NO_SUPPORT):
                    LOG.warn(_LW('URI %(uri)s does not support full set of host capabilities: %(error)s'), {'uri': self.uri(), 'error': ex})
                else:
                    raise
    return self._caps
Returns an instance of config.LibvirtConfigCaps representing
the capabilities of the host.
def _get_host_capabilities(self):
    'Returns an instance of config.LibvirtConfigCaps representing\n           the capabilities of the host.\n        '
    if (not self._caps):
        xmlstr = self._conn.getCapabilities()
        self._caps = vconfig.LibvirtConfigCaps()
        self._caps.parse_str(xmlstr)
        if hasattr(libvirt, 'VIR_CONNECT_BASELINE_CPU_EXPAND_FEATURES'):
            try:
                features = self._conn.baselineCPU([self._caps.host.cpu.to_xml()], libvirt.VIR_CONNECT_BASELINE_CPU_EXPAND_FEATURES)
                if (features and (features != (- 1))):
                    cpu = vconfig.LibvirtConfigCPU()
                    cpu.parse_str(features)
                    self._caps.host.cpu.features = cpu.features
            except libvirt.libvirtError as ex:
                error_code = ex.get_error_code()
                if (error_code == libvirt.VIR_ERR_NO_SUPPORT):
                    LOG.warn(_LW('URI %(uri)s does not support full set of host capabilities: %(error)s'), {'uri': self.uri(), 'error': ex})
                else:
                    raise
    return self._caps