[PATCH 1/3] util: check swtpm nvram-backend-dir capability

marcandre.lureau@redhat.com posted 3 patches 2 months, 3 weeks ago
There is a newer version of this series
[PATCH 1/3] util: check swtpm nvram-backend-dir capability
Posted by marcandre.lureau@redhat.com 2 months, 3 weeks ago
From: Marc-André Lureau <marcandre.lureau@redhat.com>

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
---
 src/util/virtpm.c | 1 +
 src/util/virtpm.h | 1 +
 2 files changed, 2 insertions(+)

diff --git a/src/util/virtpm.c b/src/util/virtpm.c
index 81fd6166cf..84ed2f0edd 100644
--- a/src/util/virtpm.c
+++ b/src/util/virtpm.c
@@ -40,6 +40,7 @@ VIR_ENUM_IMPL(virTPMSwtpmFeature,
               VIR_TPM_SWTPM_FEATURE_LAST,
               "cmdarg-pwd-fd",
               "cmdarg-migration",
+              "nvram-backend-dir",
 );
 
 VIR_ENUM_IMPL(virTPMSwtpmSetupFeature,
diff --git a/src/util/virtpm.h b/src/util/virtpm.h
index fb330effa8..088bb2f667 100644
--- a/src/util/virtpm.h
+++ b/src/util/virtpm.h
@@ -31,6 +31,7 @@ bool virTPMHasSwtpm(void);
 typedef enum {
     VIR_TPM_SWTPM_FEATURE_CMDARG_PWD_FD,
     VIR_TPM_SWTPM_FEATURE_CMDARG_MIGRATION,
+    VIR_TPM_SWTPM_FEATURE_NVRAM_BACKEND_DIR,
 
     VIR_TPM_SWTPM_FEATURE_LAST
 } virTPMSwtpmFeature;
-- 
2.45.2.827.g557ae147e6
Re: [PATCH 1/3] util: check swtpm nvram-backend-dir capability
Posted by Daniel P. Berrangé 2 months, 3 weeks ago
On Wed, Aug 28, 2024 at 11:02:27AM +0400, marcandre.lureau@redhat.com wrote:
> From: Marc-André Lureau <marcandre.lureau@redhat.com>
> 
> Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
> ---
>  src/util/virtpm.c | 1 +
>  src/util/virtpm.h | 1 +
>  2 files changed, 2 insertions(+)
> 
> diff --git a/src/util/virtpm.c b/src/util/virtpm.c
> index 81fd6166cf..84ed2f0edd 100644
> --- a/src/util/virtpm.c
> +++ b/src/util/virtpm.c
> @@ -40,6 +40,7 @@ VIR_ENUM_IMPL(virTPMSwtpmFeature,
>                VIR_TPM_SWTPM_FEATURE_LAST,
>                "cmdarg-pwd-fd",
>                "cmdarg-migration",
> +              "nvram-backend-dir",
>  );

This looks a bit wierd. You're probing for 'nvram-backend-dir'
but IIUC patch three is actually creating an swtpm args related
to 'nvramd-backend-file'.

I presume this works because both nvram-backend-file &
nvram-backend-dir were introduced at the same time, but I think
it'd still make more sense to probe the new one we're using

>  
>  VIR_ENUM_IMPL(virTPMSwtpmSetupFeature,
> diff --git a/src/util/virtpm.h b/src/util/virtpm.h
> index fb330effa8..088bb2f667 100644
> --- a/src/util/virtpm.h
> +++ b/src/util/virtpm.h
> @@ -31,6 +31,7 @@ bool virTPMHasSwtpm(void);
>  typedef enum {
>      VIR_TPM_SWTPM_FEATURE_CMDARG_PWD_FD,
>      VIR_TPM_SWTPM_FEATURE_CMDARG_MIGRATION,
> +    VIR_TPM_SWTPM_FEATURE_NVRAM_BACKEND_DIR,
>  
>      VIR_TPM_SWTPM_FEATURE_LAST
>  } virTPMSwtpmFeature;
> -- 
> 2.45.2.827.g557ae147e6
> 

With regards,
Daniel
-- 
|: https://berrange.com      -o-    https://www.flickr.com/photos/dberrange :|
|: https://libvirt.org         -o-            https://fstop138.berrange.com :|
|: https://entangle-photo.org    -o-    https://www.instagram.com/dberrange :|