[virt-manager] [PATCH 2/7] domcaps: tpm: Add function supports_tpm_v2()

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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





[Index of Archives]     [Linux Virtualization]     [KVM Development]     [CentOS Virtualization]     [Netdev]     [Ethernet Bridging]     [Linux Wireless]     [Kernel Newbies]     [Security]     [Linux for Hams]     [Netfilter]     [Bugtraq]     [Yosemite Forum]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux Admin]     [Samba]     [Video 4 Linux]

  Powered by Linux