From: Andrea Bolognani Date: Fri, 4 Feb 2022 15:31:01 +0000 (+0100) Subject: qemu: Drop qemuTPMEmulatorInitStorage() X-Git-Tag: v8.1.0-rc1~176 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=b12779dc80d180357c481732d526b3c73e04d722;p=thirdparty%2Flibvirt.git qemu: Drop qemuTPMEmulatorInitStorage() Absorb it into qemuTPMEmulatorCreateStorage(), its only caller. Signed-off-by: Andrea Bolognani --- diff --git a/src/qemu/qemu_tpm.c b/src/qemu/qemu_tpm.c index 182209bda6..127a2c80be 100644 --- a/src/qemu/qemu_tpm.c +++ b/src/qemu/qemu_tpm.c @@ -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: * @storagepath: directory for swtpm's persistent state @@ -143,8 +119,13 @@ qemuTPMEmulatorCreateStorage(const char *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; + } *created = false;