mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-01-03 11:35:19 +00:00
qemu: Drop qemuTPMEmulatorInitStorage()
Absorb it into qemuTPMEmulatorCreateStorage(), its only caller. Signed-off-by: Andrea Bolognani <abologna@redhat.com>
This commit is contained in:
parent
4d0cff4221
commit
b12779dc80
@ -99,30 +99,6 @@ qemuTPMCreateEmulatorLogPath(const char *logDir,
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/*
|
|
||||||
* qemuTPMEmulatorInitStorage
|
|
||||||
*
|
|
||||||
* Initialize the TPM Emulator storage by creating its root directory,
|
|
||||||
* which is typically found in /var/lib/libvirt/tpm.
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
static int
|
|
||||||
qemuTPMEmulatorInitStorage(const char *swtpmStorageDir)
|
|
||||||
{
|
|
||||||
int rc = 0;
|
|
||||||
|
|
||||||
/* allow others to cd into this dir */
|
|
||||||
if (g_mkdir_with_parents(swtpmStorageDir, 0711) < 0) {
|
|
||||||
virReportSystemError(errno,
|
|
||||||
_("Could not create TPM directory %s"),
|
|
||||||
swtpmStorageDir);
|
|
||||||
rc = -1;
|
|
||||||
}
|
|
||||||
|
|
||||||
return rc;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* qemuTPMEmulatorCreateStorage:
|
* qemuTPMEmulatorCreateStorage:
|
||||||
* @storagepath: directory for swtpm's persistent state
|
* @storagepath: directory for swtpm's persistent state
|
||||||
@ -143,8 +119,13 @@ qemuTPMEmulatorCreateStorage(const char *storagepath,
|
|||||||
{
|
{
|
||||||
g_autofree char *swtpmStorageDir = g_path_get_dirname(storagepath);
|
g_autofree char *swtpmStorageDir = g_path_get_dirname(storagepath);
|
||||||
|
|
||||||
if (qemuTPMEmulatorInitStorage(swtpmStorageDir) < 0)
|
/* allow others to cd into this dir */
|
||||||
|
if (g_mkdir_with_parents(swtpmStorageDir, 0711) < 0) {
|
||||||
|
virReportSystemError(errno,
|
||||||
|
_("Could not create TPM directory %s"),
|
||||||
|
swtpmStorageDir);
|
||||||
return -1;
|
return -1;
|
||||||
|
}
|
||||||
|
|
||||||
*created = false;
|
*created = false;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user