]> xenbits.xensource.com Git - libvirt.git/commitdiff
virtpm: Use corresponding type for argument for virTPM*CapsGet()
authorMichal Privoznik <mprivozn@redhat.com>
Wed, 20 Jul 2022 07:11:31 +0000 (09:11 +0200)
committerMichal Privoznik <mprivozn@redhat.com>
Tue, 2 Aug 2022 07:03:17 +0000 (09:03 +0200)
In virtpm.h there are two functions exposed for querying swtpm
and swtpm_setup capabilities: virTPMSwtpmCapsGet() and
virTPMSwtpmSetupCapsGet(), respectively. The capabilities we are
interested in are defined in two separate enums
(virTPMSwtpmFeature and virTPMSwtpmSetupFeature), but these
functions accept capability as an unsigned int rather than their
respective enum. While this makes sense for
virTPMBinaryGetCaps(), which is a module internal helper that
both exposed functions call, there's no need for the functions
themselves to accept unsigned int.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Andrea Bolognani <abologna@redhat.com>
src/util/virtpm.c
src/util/virtpm.h

index 3c961c11cbd0d0097fec33145a99ecf6c2bbc66c..2f2b061fee51f72e0f6bb9d6e4fb887bccff455f 100644 (file)
@@ -345,13 +345,13 @@ virTPMBinaryGetCaps(virTPMBinary binary,
 }
 
 bool
-virTPMSwtpmCapsGet(unsigned int cap)
+virTPMSwtpmCapsGet(virTPMSwtpmFeature cap)
 {
     return virTPMBinaryGetCaps(VIR_TPM_BINARY_SWTPM, cap);
 }
 
 bool
-virTPMSwtpmSetupCapsGet(unsigned int cap)
+virTPMSwtpmSetupCapsGet(virTPMSwtpmSetupFeature cap)
 {
     return virTPMBinaryGetCaps(VIR_TPM_BINARY_SWTPM_SETUP, cap);
 }
index 89adbdf7208dcf0943a7ed8b65623a561c9b6825..a873881b236995a7afde0fbbf82511e77b5306d9 100644 (file)
@@ -28,9 +28,6 @@ char *virTPMGetSwtpmIoctl(void);
 
 bool virTPMHasSwtpm(void);
 
-bool virTPMSwtpmCapsGet(unsigned int cap);
-bool virTPMSwtpmSetupCapsGet(unsigned int cap);
-
 typedef enum {
     VIR_TPM_SWTPM_FEATURE_CMDARG_PWD_FD,
 
@@ -50,3 +47,6 @@ typedef enum {
 
 VIR_ENUM_DECL(virTPMSwtpmFeature);
 VIR_ENUM_DECL(virTPMSwtpmSetupFeature);
+
+bool virTPMSwtpmCapsGet(virTPMSwtpmFeature cap);
+bool virTPMSwtpmSetupCapsGet(virTPMSwtpmSetupFeature cap);