[virt-tools-list] [virt-manager PATCH 2/5] tpm: add CRB device model

marcandre.lureau at redhat.com marcandre.lureau at redhat.com
Thu May 24 10:39:14 UTC 2018


From: Marc-André Lureau <marcandre.lureau at redhat.com>

Signed-off-by: Marc-André Lureau <marcandre.lureau at redhat.com>
---
 .../compare/virt-install-singleton-config-2.xml        | 10 ++++++++++
 tests/clitest.py                                       |  1 +
 tests/xmlparse-xml/change-tpm-out.xml                  |  2 +-
 tests/xmlparse.py                                      |  2 +-
 virtinst/devices/tpm.py                                |  5 ++++-
 5 files changed, 17 insertions(+), 3 deletions(-)

diff --git a/tests/cli-test-xml/compare/virt-install-singleton-config-2.xml b/tests/cli-test-xml/compare/virt-install-singleton-config-2.xml
index ec36f215..8cd92544 100644
--- a/tests/cli-test-xml/compare/virt-install-singleton-config-2.xml
+++ b/tests/cli-test-xml/compare/virt-install-singleton-config-2.xml
@@ -143,6 +143,11 @@
         <device path="/dev/tpm0"/>
       </backend>
     </tpm>
+    <tpm model="tpm-crb">
+      <backend type="passthrough">
+        <device path="/dev/tpm0"/>
+      </backend>
+    </tpm>
     <graphics type="vnc" port="-1"/>
     <watchdog model="ib700" action="pause"/>
     <memballoon model="virtio"/>
@@ -312,6 +317,11 @@
         <device path="/dev/tpm0"/>
       </backend>
     </tpm>
+    <tpm model="tpm-crb">
+      <backend type="passthrough">
+        <device path="/dev/tpm0"/>
+      </backend>
+    </tpm>
     <graphics type="vnc" port="-1"/>
     <watchdog model="ib700" action="pause"/>
     <memballoon model="virtio"/>
diff --git a/tests/clitest.py b/tests/clitest.py
index a62a9105..5271935f 100644
--- a/tests/clitest.py
+++ b/tests/clitest.py
@@ -449,6 +449,7 @@ cache.mode=emulate,cache.level=3 \
 --memballoon virtio \
 --watchdog ib700,action=pause \
 --tpm passthrough,model=tpm-tis,path=/dev/tpm0 \
+--tpm passthrough,model=tpm-crb,path=/dev/tpm0 \
 --rng egd,backend_host=127.0.0.1,backend_service=8000,backend_type=udp,backend_mode=bind,backend_connect_host=foo,backend_connect_service=708 \
 --panic iobase=0x506 \
 """, "singleton-config-2")
diff --git a/tests/xmlparse-xml/change-tpm-out.xml b/tests/xmlparse-xml/change-tpm-out.xml
index 47d0dfdc..7bdd0226 100644
--- a/tests/xmlparse-xml/change-tpm-out.xml
+++ b/tests/xmlparse-xml/change-tpm-out.xml
@@ -50,7 +50,7 @@
     </interface>
     <graphics type="vnc" display=":3.4" xauth="/tmp/.Xauthority"/>
     <console type="pty"/>
-    <tpm model="tpm-tis">
+    <tpm model="tpm-crb">
       <backend type="passthrough">
         <device path="frob"/>
       </backend>
diff --git a/tests/xmlparse.py b/tests/xmlparse.py
index 3e02a5c1..4b5b3026 100644
--- a/tests/xmlparse.py
+++ b/tests/xmlparse.py
@@ -909,7 +909,7 @@ class XMLParseTest(unittest.TestCase):
 
         check = self._make_checker(dev1)
         check("type", "passthrough", "foo", "passthrough")
-        check("model", "tpm-tis", "tpm-tis")
+        check("model", "tpm-tis", "tpm-crb")
         check("device_path", "/dev/tpm0", "frob")
 
         self._alter_compare(guest.get_xml_config(), outfile)
diff --git a/virtinst/devices/tpm.py b/virtinst/devices/tpm.py
index 634f8b52..ab7492ed 100644
--- a/virtinst/devices/tpm.py
+++ b/virtinst/devices/tpm.py
@@ -21,8 +21,9 @@ class DeviceTpm(Device):
     TYPES = [TYPE_PASSTHROUGH]
 
     MODEL_TIS = "tpm-tis"
+    MODEL_CRB = "tpm-crb"
     MODEL_DEFAULT = "default"
-    MODELS = [MODEL_TIS]
+    MODELS = [MODEL_TIS, MODEL_CRB]
 
     @staticmethod
     def get_pretty_type(tpm_type):
@@ -34,6 +35,8 @@ class DeviceTpm(Device):
     def get_pretty_model(tpm_model):
         if tpm_model == DeviceTpm.MODEL_TIS:
             return _("TIS")
+        if tpm_model == DeviceTpm.MODEL_CRB:
+            return _("CRB")
         return tpm_model
 
     def supports_property(self, propname):
-- 
2.17.0.253.g3dd125b46d




More information about the virt-tools-list mailing list