[PATCH] security_dac: Use virDomainTPMBackendType when possible

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



It's certainly useful to use enum typecast in switch().
Currently, it's not used only in two places:
virSecurityDACSetSecurityTPMFileLabel and
virSecurityDACRestoreSecurityTPMFileLabel.

Signed-off-by: Michal Privoznik <mprivozn@xxxxxxxxxx>
---
 src/security/security_dac.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/security/security_dac.c b/src/security/security_dac.c
index 05303e7..7e0f160 100644
--- a/src/security/security_dac.c
+++ b/src/security/security_dac.c
@@ -847,7 +847,7 @@ virSecurityDACSetSecurityTPMFileLabel(virSecurityManagerPtr mgr,
 {
     int ret = 0;
 
-    switch (tpm->type) {
+    switch ((enum virDomainTPMBackendType) tpm->type) {
     case VIR_DOMAIN_TPM_TYPE_PASSTHROUGH:
         ret = virSecurityDACSetChardevLabel(mgr, def, NULL,
                                             &tpm->data.passthrough.source);
@@ -867,7 +867,7 @@ virSecurityDACRestoreSecurityTPMFileLabel(virSecurityManagerPtr mgr,
 {
     int ret = 0;
 
-    switch (tpm->type) {
+    switch ((enum virDomainTPMBackendType) tpm->type) {
     case VIR_DOMAIN_TPM_TYPE_PASSTHROUGH:
         ret = virSecurityDACRestoreChardevLabel(mgr, def, NULL,
                                           &tpm->data.passthrough.source);
-- 
1.9.3

--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list




[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]