]> xenbits.xensource.com Git - libvirt.git/commitdiff
qemu: Rename qemuTPM{Create,Delete}EmulatorStorage()
authorAndrea Bolognani <abologna@redhat.com>
Fri, 4 Feb 2022 16:20:38 +0000 (17:20 +0100)
committerAndrea Bolognani <abologna@redhat.com>
Sat, 5 Feb 2022 13:36:11 +0000 (14:36 +0100)
Other functions that operate on a single TPM emulator follow
the qemuTPMEmulatorDoThing() naming convention.

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
src/qemu/qemu_tpm.c

index 627c7e631d480d59e5744f689a224e3ef025f68d..8d66a2127eaba0069e123a33a0a08c3cf44c0767 100644 (file)
@@ -123,9 +123,8 @@ qemuTPMEmulatorInitStorage(const char *swtpmStorageDir)
 }
 
 
-/*
- * qemuTPMCreateEmulatorStorage
- *
+/**
+ * qemuTPMEmulatorCreateStorage:
  * @storagepath: directory for swtpm's persistent state
  * @created: a pointer to a bool that will be set to true if the
  *           storage was created because it did not exist yet
@@ -137,7 +136,7 @@ qemuTPMEmulatorInitStorage(const char *swtpmStorageDir)
  * Adapt ownership of the directory and all swtpm's state files there.
  */
 static int
-qemuTPMCreateEmulatorStorage(const char *storagepath,
+qemuTPMEmulatorCreateStorage(const char *storagepath,
                              bool *created,
                              uid_t swtpm_user,
                              gid_t swtpm_group)
@@ -168,7 +167,7 @@ qemuTPMCreateEmulatorStorage(const char *storagepath,
 
 
 static void
-qemuTPMDeleteEmulatorStorage(virDomainTPMDef *tpm)
+qemuTPMEmulatorDeleteStorage(virDomainTPMDef *tpm)
 {
     g_autofree char *path =  g_path_get_dirname(tpm->data.emulator.storagepath);
 
@@ -686,7 +685,7 @@ qemuTPMEmulatorBuildCommand(virDomainTPMDef *tpm,
     if (!swtpm)
         return NULL;
 
-    if (qemuTPMCreateEmulatorStorage(tpm->data.emulator.storagepath,
+    if (qemuTPMEmulatorCreateStorage(tpm->data.emulator.storagepath,
                                      &created, swtpm_user, swtpm_group) < 0)
         return NULL;
 
@@ -765,7 +764,7 @@ qemuTPMEmulatorBuildCommand(virDomainTPMDef *tpm,
 
  error:
     if (created)
-        qemuTPMDeleteEmulatorStorage(tpm);
+        qemuTPMEmulatorDeleteStorage(tpm);
 
     return NULL;
 }
@@ -870,7 +869,7 @@ qemuExtTPMCleanupHost(virDomainDef *def)
             continue;
 
         if (!def->tpms[i]->data.emulator.persistent_state)
-            qemuTPMDeleteEmulatorStorage(def->tpms[i]);
+            qemuTPMEmulatorDeleteStorage(def->tpms[i]);
     }
 }