[virt-tools-list] [virt-manager PATCH 1/8] domcapabilities: fix detection if host-model is safe to use

Pavel Hrdina phrdina at redhat.com
Fri Mar 15 16:41:35 UTC 2019


According to libvirt documentation for host-model [1] it is safe to use
it only if 'fallback' attribute is set to 'forbid', this indicates that
the libvirt and QEMU are new enough and can safely filter list of cpu
features that will be guaranteed to be visible inside of the guest.

[1] <https://libvirt.org/formatdomain.html#elementsCPU>

Signed-off-by: Pavel Hrdina <phrdina at redhat.com>
---
 virtinst/domcapabilities.py | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/virtinst/domcapabilities.py b/virtinst/domcapabilities.py
index 4cbb7f20..4d505225 100644
--- a/virtinst/domcapabilities.py
+++ b/virtinst/domcapabilities.py
@@ -227,9 +227,9 @@ class DomainCapabilities(XMLBuilder):
         """
         Return True if domcaps reports support for cpu mode=host-model.
         host-model infact predates this support, however it wasn't
-        general purpose safe prior to domcaps advertisement
+        general purpose safe prior to domcaps advertisement.
         """
-        return [(m.name == "host-model" and m.supported)
+        return [(m.name == "host-model" and m.models[0].fallback == "forbid")
                 for m in self.cpu.modes]
 
 
-- 
2.20.1




More information about the virt-tools-list mailing list