domcapabilities: fix CPUModel usable attribute

It is not True/False attribute, it can contain 'unknown' value as well
which means libvirt cannot figure out whether the CPU model is usable
with that specific QEMU binary.

Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
Reviewed-by: Cole Robinson <crobinso@redhat.com>
This commit is contained in:
Pavel Hrdina 2019-03-14 14:10:26 +01:00
parent f7bdebc0de
commit 8183ba279c
2 changed files with 2 additions and 2 deletions

View File

@ -239,7 +239,7 @@ class DomainCpu(XMLBuilder):
return
cpu_model = domcaps_mode.get_model(self.model)
if cpu_model and cpu_model.usable:
if cpu_model and cpu_model.usable != "no":
return
logging.debug("Host capabilities CPU '%s' is not supported "

View File

@ -94,7 +94,7 @@ class _Features(_CapsBlock):
class _CPUModel(XMLBuilder):
XML_NAME = "model"
model = XMLProperty(".")
usable = XMLProperty("./@usable", is_yesno=True)
usable = XMLProperty("./@usable")
fallback = XMLProperty("./@fallback")