]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
qemu_tpm: Rename qemuTPMHasSharedStorage -> qemuTPMDomainHasSharedStorage
authorMartin Kletzander <mkletzan@redhat.com>
Thu, 17 Jul 2025 09:51:39 +0000 (11:51 +0200)
committerMartin Kletzander <mkletzan@redhat.com>
Thu, 17 Jul 2025 12:04:52 +0000 (14:04 +0200)
The function deals with the whole domain and the part that handles one
TPM will be useful elsewhere and hence extracted later.  This rename
makes it possible for the new function to use the original name of this
renamed one.

Signed-off-by: Martin Kletzander <mkletzan@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
src/qemu/qemu_migration.c
src/qemu/qemu_tpm.c
src/qemu/qemu_tpm.h

index c8974dbc5b97215d78f9c323a3b3da4a08a0a698..b22248e3b92fb35020c70cdfa5f3b145a0fca10e 100644 (file)
@@ -1721,7 +1721,7 @@ qemuMigrationSrcIsAllowed(virDomainObj *vm,
             }
         }
 
-        if (qemuTPMHasSharedStorage(driver, vm->def) &&
+        if (qemuTPMDomainHasSharedStorage(driver, vm->def) &&
             !qemuTPMCanMigrateSharedStorage(vm->def)) {
             virReportError(VIR_ERR_OPERATION_UNSUPPORTED, "%s",
                            _("the running swtpm does not support migration with shared storage"));
index b2f76e6b8b3153f022535d9715b1fb84964799d3..8c104ab1b3038f9976bcd31ad7b0d6da3040ee13 100644 (file)
@@ -1150,7 +1150,7 @@ qemuTPMEmulatorStart(virQEMUDriver *driver,
     virCommandSetPidFile(cmd, pidfile);
     virCommandSetErrorFD(cmd, &errfd);
 
-    if (incomingMigration && qemuTPMHasSharedStorage(driver, vm->def)) {
+    if (incomingMigration && qemuTPMDomainHasSharedStorage(driver, vm->def)) {
         /* If the TPM is being migrated over shared storage, we can't
          * lock all files before labeling them: the source swtpm
          * process is still holding on to the lock file, and it will
@@ -1219,8 +1219,8 @@ qemuTPMEmulatorStart(virQEMUDriver *driver,
 
 
 bool
-qemuTPMHasSharedStorage(virQEMUDriver *driver,
-                        virDomainDef *def)
+qemuTPMDomainHasSharedStorage(virQEMUDriver *driver,
+                              virDomainDef *def)
 {
     g_autoptr(virQEMUDriverConfig) cfg = virQEMUDriverGetConfig(driver);
     size_t i;
@@ -1346,7 +1346,7 @@ qemuExtTPMStop(virQEMUDriver *driver,
         return;
 
     qemuTPMEmulatorStop(cfg->swtpmStateDir, shortName);
-    if (migration && qemuTPMHasSharedStorage(driver, vm->def))
+    if (migration && qemuTPMDomainHasSharedStorage(driver, vm->def))
         restoreTPMStateLabel = false;
 
     if (qemuSecurityRestoreTPMLabels(driver, vm, restoreTPMStateLabel, false) < 0)
index f0f16392a16593dbb974fb90209372d0966d704a..2d633fe36b844543918168c46d13d4262640e121 100644 (file)
@@ -61,8 +61,8 @@ int qemuExtTPMSetupCgroup(virQEMUDriver *driver,
     ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2) ATTRIBUTE_NONNULL(3)
     G_GNUC_WARN_UNUSED_RESULT;
 
-bool qemuTPMHasSharedStorage(virQEMUDriver *driver,
-                             virDomainDef *def)
+bool qemuTPMDomainHasSharedStorage(virQEMUDriver *driver,
+                                   virDomainDef *def)
     ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2)
     G_GNUC_WARN_UNUSED_RESULT;