[libvirt PATCH 07/16] virDomainFeaturesKVMDefParse: Remove tautological "switch"

Tim Wiederhake posted 16 patches 3 years, 4 months ago
[libvirt PATCH 07/16] virDomainFeaturesKVMDefParse: Remove tautological "switch"
Posted by Tim Wiederhake 3 years, 4 months ago
`feature` is always one of the values listed in the switch,
ensured by `virDomainKVMTypeFromString` above.

Signed-off-by: Tim Wiederhake <twiederh@redhat.com>
---
 src/conf/domain_conf.c | 18 ++++--------------
 1 file changed, 4 insertions(+), 14 deletions(-)

diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c
index 2ad4cbc5a3..62565601ab 100644
--- a/src/conf/domain_conf.c
+++ b/src/conf/domain_conf.c
@@ -17418,21 +17418,11 @@ virDomainFeaturesKVMDefParse(virDomainDef *def,
                 return -1;
             }
 
-            switch ((virDomainKVM) feature) {
-                case VIR_DOMAIN_KVM_HIDDEN:
-                case VIR_DOMAIN_KVM_DEDICATED:
-                case VIR_DOMAIN_KVM_POLLCONTROL:
-                    if (virXMLPropTristateSwitch(node, "state",
-                                                 VIR_XML_PROP_REQUIRED,
-                                                 &value) < 0)
-                        return -1;
-
-                    def->kvm_features[feature] = value;
-                    break;
+            if (virXMLPropTristateSwitch(node, "state", VIR_XML_PROP_REQUIRED,
+                                         &value) < 0)
+                return -1;
 
-                case VIR_DOMAIN_KVM_LAST:
-                    break;
-            }
+            def->kvm_features[feature] = value;
 
             node = xmlNextElementSibling(node);
         }
-- 
2.31.1