mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-03-07 17:28:15 +00:00
conf: remove pointless check on enum value
'val' is initialized from virDomainCapsFeatureTypeFromString and a few lines earlier there was already a check for 'val < 0'. The 'val >= 0' is thus always true. The enum conversion similarly ensures that the val will be less than VIR_DOMAIN_CAPS_FEATURE_LAST, so "val < VIR_DOMAIN_CAPS_FEATURE_LAST' is thus always true too. Reviewed-by: John Ferlan <jferlan@redhat.com> Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
This commit is contained in:
parent
d56afb8e39
commit
df7b679c58
@ -20524,7 +20524,6 @@ virDomainDefParseXML(xmlDocPtr xml,
|
|||||||
goto error;
|
goto error;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (val >= 0 && val < VIR_DOMAIN_CAPS_FEATURE_LAST) {
|
|
||||||
if ((tmp = virXMLPropString(nodes[i], "state"))) {
|
if ((tmp = virXMLPropString(nodes[i], "state"))) {
|
||||||
if ((def->caps_features[val] = virTristateSwitchTypeFromString(tmp)) == -1) {
|
if ((def->caps_features[val] = virTristateSwitchTypeFromString(tmp)) == -1) {
|
||||||
virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
|
virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
|
||||||
@ -20537,7 +20536,6 @@ virDomainDefParseXML(xmlDocPtr xml,
|
|||||||
def->caps_features[val] = VIR_TRISTATE_SWITCH_ON;
|
def->caps_features[val] = VIR_TRISTATE_SWITCH_ON;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
VIR_FREE(nodes);
|
VIR_FREE(nodes);
|
||||||
|
|
||||||
if (virDomainEventActionParseXML(ctxt, "on_reboot",
|
if (virDomainEventActionParseXML(ctxt, "on_reboot",
|
||||||
|
Loading…
x
Reference in New Issue
Block a user