From: Andrea Bolognani Date: Fri, 4 Feb 2022 16:26:23 +0000 (+0100) Subject: qemu: Make qemuTPMEmulatorCreateStorage() take a virDomainTPMDef* X-Git-Url: http://xenbits.xensource.com/gitweb?a=commitdiff_plain;h=a9763e8e38465aa99432389f4fb42bc1d20a2be2;p=libvirt.git qemu: Make qemuTPMEmulatorCreateStorage() take a virDomainTPMDef* This matches how qemuTPMEmulatorDeleteStorage() expects to be called. Signed-off-by: Andrea Bolognani --- diff --git a/src/qemu/qemu_tpm.c b/src/qemu/qemu_tpm.c index 127a2c80be..2196b5c567 100644 --- a/src/qemu/qemu_tpm.c +++ b/src/qemu/qemu_tpm.c @@ -101,7 +101,7 @@ qemuTPMCreateEmulatorLogPath(const char *logDir, /** * qemuTPMEmulatorCreateStorage: - * @storagepath: directory for swtpm's persistent state + * @tpm: TPM definition for an emulator type * @created: a pointer to a bool that will be set to true if the * storage was created because it did not exist yet * @swtpm_user: The uid that needs to be able to access the directory @@ -112,11 +112,12 @@ qemuTPMCreateEmulatorLogPath(const char *logDir, * Adapt ownership of the directory and all swtpm's state files there. */ static int -qemuTPMEmulatorCreateStorage(const char *storagepath, +qemuTPMEmulatorCreateStorage(virDomainTPMDef *tpm, bool *created, uid_t swtpm_user, gid_t swtpm_group) { + const char *storagepath = tpm->data.emulator.storagepath; g_autofree char *swtpmStorageDir = g_path_get_dirname(storagepath); /* allow others to cd into this dir */ @@ -672,8 +673,7 @@ qemuTPMEmulatorBuildCommand(virDomainTPMDef *tpm, if (!swtpm) return NULL; - if (qemuTPMEmulatorCreateStorage(tpm->data.emulator.storagepath, - &created, swtpm_user, swtpm_group) < 0) + if (qemuTPMEmulatorCreateStorage(tpm, &created, swtpm_user, swtpm_group) < 0) return NULL; if (tpm->data.emulator.hassecretuuid)