]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
Revert "qemu: explicit swtpm state locking"
authorMarc-André Lureau <marcandre.lureau@redhat.com>
Wed, 11 Dec 2024 10:37:12 +0000 (14:37 +0400)
committerMichal Privoznik <mprivozn@redhat.com>
Mon, 6 Jan 2025 14:58:15 +0000 (15:58 +0100)
This reverts commit bb5e26749fe5b5856a3541be2cbe147701e6e121.

swtpm-setup doesn't have "tpmstate-lock", only swtpm.

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Reviewed-by: Stefan Berger <stefanb@linux.ibm.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
src/qemu/qemu_tpm.c
src/util/virtpm.c
src/util/virtpm.h
tests/testutilsqemu.c

index f5e0184e540c2cc5ec25a37802e73add4549a48b..476e3dd2245795a12a3ac1db03b27d3835733baa 100644 (file)
@@ -344,23 +344,16 @@ static char *
 qemuTPMGetSwtpmSetupStateArg(const virDomainTPMSourceType source_type,
                              const char *source_path)
 {
-    const char *lock = ",lock";
-
-    if (!virTPMSwtpmSetupCapsGet(VIR_TPM_SWTPM_SETUP_FEATURE_TPMSTATE_OPT_LOCK)) {
-        VIR_WARN("This swtpm version doesn't support explicit locking");
-        lock = "";
-    }
-
     switch (source_type) {
     case VIR_DOMAIN_TPM_SOURCE_TYPE_FILE:
         /* the file:// prefix is supported since swtpm_setup 0.7.0 */
         /* assume the capability check for swtpm is redundant. */
-        return g_strdup_printf("file://%s%s", source_path, lock);
+        return g_strdup_printf("file://%s", source_path);
     case VIR_DOMAIN_TPM_SOURCE_TYPE_DIR:
     case VIR_DOMAIN_TPM_SOURCE_TYPE_DEFAULT:
     case VIR_DOMAIN_TPM_SOURCE_TYPE_LAST:
     default:
-        return g_strdup_printf("%s%s", source_path, lock);
+        return g_strdup_printf("%s", source_path);
     }
 }
 
index 4016ad8fc4d6aecf9e80d82bc9a8f4968b58aff3..f90839debeee1b833c7a260d7cc472cdae13fe4e 100644 (file)
@@ -53,7 +53,6 @@ VIR_ENUM_IMPL(virTPMSwtpmSetupFeature,
               "cmdarg-reconfigure-pcr-banks",
               "tpm-1.2",
               "tpm-2.0",
-              "tpmstate-opt-lock",
               "cmdarg-profile",
 );
 
index 03fb92629a6fa9e6b0628b0b698bfa815c9afb5f..4119a903e527bfa046e6445601f55f48df4b7024 100644 (file)
@@ -45,7 +45,6 @@ typedef enum {
     VIR_TPM_SWTPM_SETUP_FEATURE_CMDARG_RECONFIGURE_PCR_BANKS,
     VIR_TPM_SWTPM_SETUP_FEATURE_TPM_1_2,
     VIR_TPM_SWTPM_SETUP_FEATURE_TPM_2_0,
-    VIR_TPM_SWTPM_SETUP_FEATURE_TPMSTATE_OPT_LOCK,
     VIR_TPM_SWTPM_SETUP_FEATURE_CMDARG_PROFILE,
 
     VIR_TPM_SWTPM_SETUP_FEATURE_LAST
index 5caccbc6b4d54882d22af19c4dfc3bbddec0ae84..abc425b9b74c68202ed530ce2ce01b06e84d012e 100644 (file)
@@ -71,7 +71,6 @@ virTPMSwtpmSetupCapsGet(virTPMSwtpmSetupFeature cap)
     case VIR_TPM_SWTPM_SETUP_FEATURE_CMDARG_CREATE_CONFIG_FILES:
     case VIR_TPM_SWTPM_SETUP_FEATURE_TPM12_NOT_NEED_ROOT:
     case VIR_TPM_SWTPM_SETUP_FEATURE_CMDARG_RECONFIGURE_PCR_BANKS:
-    case VIR_TPM_SWTPM_SETUP_FEATURE_TPMSTATE_OPT_LOCK:
     case VIR_TPM_SWTPM_SETUP_FEATURE_CMDARG_PROFILE:
     case VIR_TPM_SWTPM_SETUP_FEATURE_LAST:
         break;