]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
util: don't export virTPMEmulatorInit method
authorDaniel P. Berrangé <berrange@redhat.com>
Wed, 24 Nov 2021 12:10:10 +0000 (12:10 +0000)
committerDaniel P. Berrangé <berrange@redhat.com>
Wed, 1 Dec 2021 12:14:03 +0000 (12:14 +0000)
Every other exported API from virtpm.h will internally call
virTPMEmulatorInit, so there is no reason for this initializer
to be exported on its own.

Reviewed-by: Ján Tomko <jtomko@redhat.com>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
src/libvirt_private.syms
src/qemu/qemu_tpm.c
src/util/virtpm.c
src/util/virtpm.h

index 1d4b4aeef25fb9ecd2c69bb9fe45a862c9034770..48b1f1568fbd8fd905e3317411cecb72a12bd4f8 100644 (file)
@@ -3448,7 +3448,6 @@ virTimeStringThenRaw;
 
 # util/virtpm.h
 virTPMCreateCancelPath;
-virTPMEmulatorInit;
 virTPMGetSwtpm;
 virTPMGetSwtpmIoctl;
 virTPMGetSwtpmSetup;
index 62f54f56ab7e652c81897bd89537853b36732c1c..1b923fd68e01108d4ecc653b01f74e144dd01888 100644 (file)
@@ -295,9 +295,6 @@ qemuTPMEmulatorPrepareHost(virDomainTPMDef *tpm,
                            uid_t qemu_user,
                            const char *shortName)
 {
-    if (virTPMEmulatorInit() < 0)
-        return -1;
-
     /* create log dir ... allow 'tss' user to cd into it */
     if (g_mkdir_with_parents(logDir, 0711) < 0)
         return -1;
@@ -804,9 +801,6 @@ qemuTPMEmulatorStop(const char *swtpmStateDir,
     if (!swtpm_ioctl)
         return;
 
-    if (virTPMEmulatorInit() < 0)
-        return;
-
     if (!(pathname = qemuTPMCreateEmulatorSocket(swtpmStateDir, shortName)))
         return;
 
index 2539ea9275d71fd44f219b9230ec378a3d9117f7..3ea3b668e2eccf472a01a9208f183ab61845dc83 100644 (file)
@@ -132,6 +132,8 @@ static virTPMBinaryInfo swtpmBinaries[VIR_TPM_BINARY_LAST] = {
     },
 };
 
+static int virTPMEmulatorInit(void);
+
 static char *
 virTPMBinaryGetPath(virTPMBinary binary)
 {
@@ -264,7 +266,7 @@ virTPMGetCaps(virTPMBinaryCapsParse capsParse,
  * Initialize the Emulator functions by searching for necessary
  * executables that we will use to start and setup the swtpm
  */
-int
+static int
 virTPMEmulatorInit(void)
 {
     int ret = -1;
index defea6c10610349401c8ae94bfda55841f81f013..4c16332f9bbb3067812a6be310be0f1aa9f6f6b7 100644 (file)
@@ -25,7 +25,6 @@ char *virTPMCreateCancelPath(const char *devpath) G_GNUC_NO_INLINE;
 char *virTPMGetSwtpm(void);
 char *virTPMGetSwtpmSetup(void);
 char *virTPMGetSwtpmIoctl(void);
-int virTPMEmulatorInit(void);
 
 bool virTPMSwtpmCapsGet(unsigned int cap);
 bool virTPMSwtpmSetupCapsGet(unsigned int cap);