It returns true if libvirt advertises tpm 2.0 in domcaps. Signed-off-by: Lin Ma <lma@xxxxxxx> --- virtinst/domcapabilities.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/virtinst/domcapabilities.py b/virtinst/domcapabilities.py index db08bf65..34d762ae 100644 --- a/virtinst/domcapabilities.py +++ b/virtinst/domcapabilities.py @@ -440,6 +440,14 @@ class DomainCapabilities(XMLBuilder): return len(models) > 0 and bool("emulator" in backends) + def supports_tpm_v2(self): + """ + Returns True if libvirt advertises tpm emulator 2.0 in domcaps + """ + versions = self.devices.tpm.get_enum("backendVersion").get_values() + + return bool("2.0" in versions) + def supports_graphics_spice(self): if not self.devices.graphics.supported: # domcaps is too old, or the driver doesn't advertise graphics -- 2.41.0