util: don't export virTPMEmulatorInit method

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>
This commit is contained in:
Daniel P. Berrangé 2021-11-24 12:10:10 +00:00
parent ac674429c3
commit c032786e08
4 changed files with 3 additions and 9 deletions

View File

@ -3448,7 +3448,6 @@ virTimeStringThenRaw;
# util/virtpm.h
virTPMCreateCancelPath;
virTPMEmulatorInit;
virTPMGetSwtpm;
virTPMGetSwtpmIoctl;
virTPMGetSwtpmSetup;

View 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;

View 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;

View 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);