Re: [PATCH v8 15/18] qemu: Validate chosen TPM model rather than overwriting it

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

 



On 06/02/2018 09:38 AM, Ján Tomko wrote:
On Thu, May 24, 2018 at 04:26:11PM -0400, Stefan Berger wrote:
TPM 1.2 does not support a CRB interface but only TIS. So, in
this case we need to alert the user and request a change to the
XML rather than silently overwriting it.

Signed-off-by: Stefan Berger <stefanb@xxxxxxxxxxxxxxxxxx>
---
src/conf/domain_conf.c | 15 ---------------
src/qemu/qemu_domain.c | 28 +++++++++++++++++++++++++++-
2 files changed, 27 insertions(+), 16 deletions(-)

diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c
index d67ccbbf11..0b244b2eac 100644
--- a/src/conf/domain_conf.c
+++ b/src/conf/domain_conf.c
@@ -12727,21 +12727,6 @@ virDomainTPMDefParseXML(virDomainXMLOptionPtr xmlopt,
        def->version = VIR_DOMAIN_TPM_VERSION_1_2;
    else
        def->version = virDomainTPMVersionTypeFromString(version);
-    switch (def->version) {
-    case VIR_DOMAIN_TPM_VERSION_1_2:
-        /* only TIS available for emulator */
-        if (def->type == VIR_DOMAIN_TPM_TYPE_EMULATOR)
-            def->model = VIR_DOMAIN_TPM_MODEL_TIS;
-        break;
-    case VIR_DOMAIN_TPM_VERSION_2:
-        break;
-    case VIR_DOMAIN_TPM_VERSION_LAST:
-    default:
-        virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
-                       _("Unsupported TPM version '%s'"),
-                       version);
-        goto error;
-    }

Deleting code newly added in the series feels strange. It should not
have been added in the first place.


    switch (def->type) {
    case VIR_DOMAIN_TPM_TYPE_PASSTHROUGH:

For the rest:

If you don't mind, I will squash this into 10/18.



Reviewed-by: Ján Tomko <jtomko@xxxxxxxxxx>

Jano


--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list




[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]

  Powered by Linux