[PATCH] qemu: Add missing 'break' statement in couple of switch()-es

Michal Privoznik posted 1 patch 3 weeks, 4 days ago
Patches applied successfully (tree, apply log)
git fetch https://github.com/patchew-project/libvirt tags/patchew/f68a0742039fa5311c4f4c24160351d66884fe21.1667998815.git.mprivozn@redhat.com
src/qemu/qemu_domain.c | 1 +
src/qemu/qemu_tpm.c    | 2 ++
2 files changed, 3 insertions(+)
[PATCH] qemu: Add missing 'break' statement in couple of switch()-es
Posted by Michal Privoznik 3 weeks, 4 days ago
In recent commits migration of TPM on shared storage was
introduced. However, I've only complied it with gcc and thus did
not notice that clang build fails due to missing break; at the
end of some (empty) cases in switch() statements.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
---

Pushed under trivial and build breaker rules.

 src/qemu/qemu_domain.c | 1 +
 src/qemu/qemu_tpm.c    | 2 ++
 2 files changed, 3 insertions(+)

diff --git a/src/qemu/qemu_domain.c b/src/qemu/qemu_domain.c
index 41e616ca48..3435da5bdc 100644
--- a/src/qemu/qemu_domain.c
+++ b/src/qemu/qemu_domain.c
@@ -1202,6 +1202,7 @@ qemuDomainTPMPrivateFormat(const virDomainTPMDef *tpm,
 
     case VIR_DOMAIN_TPM_TYPE_PASSTHROUGH:
     case VIR_DOMAIN_TPM_TYPE_LAST:
+        break;
     }
 
     return 0;
diff --git a/src/qemu/qemu_tpm.c b/src/qemu/qemu_tpm.c
index dc15514ca6..15ee7db757 100644
--- a/src/qemu/qemu_tpm.c
+++ b/src/qemu/qemu_tpm.c
@@ -1019,6 +1019,7 @@ qemuTPMHasSharedStorage(virDomainDef *def)
             return virFileIsSharedFS(tpm->data.emulator.storagepath) == 1;
         case VIR_DOMAIN_TPM_TYPE_PASSTHROUGH:
         case VIR_DOMAIN_TPM_TYPE_LAST:
+            break;
         }
     }
 
@@ -1038,6 +1039,7 @@ qemuTPMCanMigrateSharedStorage(virDomainDef *def)
             return QEMU_DOMAIN_TPM_PRIVATE(tpm)->swtpm.can_migrate_shared_storage;
         case VIR_DOMAIN_TPM_TYPE_PASSTHROUGH:
         case VIR_DOMAIN_TPM_TYPE_LAST:
+            break;
         }
     }
     return true;
-- 
2.37.4