DomainCpu: check CPU model name only if model exists
For CPU modes other then "custom" there is no model so we should not check the suffix of model name. Signed-off-by: Pavel Hrdina <phrdina@redhat.com> Reviewed-by: Cole Robinson <crobinso@redhat.com>
This commit is contained in:
parent
291f2ef214
commit
c1ebd6730c
|
@ -342,10 +342,16 @@ class XMLParseTest(unittest.TestCase):
|
||||||
|
|
||||||
check = self._make_checker(guest.cpu)
|
check = self._make_checker(guest.cpu)
|
||||||
check("mode", "host-passthrough")
|
check("mode", "host-passthrough")
|
||||||
|
guest.cpu.check_security_features(guest)
|
||||||
|
check("secure", False)
|
||||||
guest.cpu.set_special_mode(guest, "host-model")
|
guest.cpu.set_special_mode(guest, "host-model")
|
||||||
check("mode", "host-model")
|
check("mode", "host-model")
|
||||||
|
guest.cpu.check_security_features(guest)
|
||||||
|
check("secure", False)
|
||||||
guest.cpu.set_model(guest, "qemu64")
|
guest.cpu.set_model(guest, "qemu64")
|
||||||
check("model", "qemu64")
|
check("model", "qemu64")
|
||||||
|
guest.cpu.check_security_features(guest)
|
||||||
|
check("secure", False)
|
||||||
|
|
||||||
self._alter_compare(guest.get_xml(), outfile)
|
self._alter_compare(guest.get_xml(), outfile)
|
||||||
|
|
||||||
|
|
|
@ -135,10 +135,11 @@ class DomainCpu(XMLBuilder):
|
||||||
return
|
return
|
||||||
|
|
||||||
guestFeatures = [f.name for f in self.features if f.policy == "require"]
|
guestFeatures = [f.name for f in self.features if f.policy == "require"]
|
||||||
if self.model.endswith("IBRS"):
|
if self.model:
|
||||||
guestFeatures.append("spec-ctrl")
|
if self.model.endswith("IBRS"):
|
||||||
if self.model.endswith("IBPB"):
|
guestFeatures.append("spec-ctrl")
|
||||||
guestFeatures.append("ibpb")
|
if self.model.endswith("IBPB"):
|
||||||
|
guestFeatures.append("ibpb")
|
||||||
|
|
||||||
self.secure = set(features) <= set(guestFeatures)
|
self.secure = set(features) <= set(guestFeatures)
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue