mirror of
https://github.com/libvirt/libvirt.git
synced 2025-02-25 18:55:26 -06:00
virDomainFeaturesKVMDefParse: Remove tautological "if"
Signed-off-by: Tim Wiederhake <twiederh@redhat.com> Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
This commit is contained in:
parent
e2bce45829
commit
b194a21a9e
@ -17404,28 +17404,26 @@ virDomainFeaturesKVMDefParse(virDomainDef *def,
|
|||||||
{
|
{
|
||||||
def->features[VIR_DOMAIN_FEATURE_KVM] = VIR_TRISTATE_SWITCH_ON;
|
def->features[VIR_DOMAIN_FEATURE_KVM] = VIR_TRISTATE_SWITCH_ON;
|
||||||
|
|
||||||
if (def->features[VIR_DOMAIN_FEATURE_KVM] == VIR_TRISTATE_SWITCH_ON) {
|
node = xmlFirstElementChild(node);
|
||||||
|
while (node) {
|
||||||
int feature;
|
int feature;
|
||||||
virTristateSwitch value;
|
virTristateSwitch value;
|
||||||
|
|
||||||
node = xmlFirstElementChild(node);
|
feature = virDomainKVMTypeFromString((const char *)node->name);
|
||||||
while (node) {
|
if (feature < 0) {
|
||||||
feature = virDomainKVMTypeFromString((const char *)node->name);
|
virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
|
||||||
if (feature < 0) {
|
_("unsupported KVM feature: %s"),
|
||||||
virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
|
node->name);
|
||||||
_("unsupported KVM feature: %s"),
|
return -1;
|
||||||
node->name);
|
|
||||||
return -1;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (virXMLPropTristateSwitch(node, "state", VIR_XML_PROP_REQUIRED,
|
|
||||||
&value) < 0)
|
|
||||||
return -1;
|
|
||||||
|
|
||||||
def->kvm_features[feature] = value;
|
|
||||||
|
|
||||||
node = xmlNextElementSibling(node);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (virXMLPropTristateSwitch(node, "state", VIR_XML_PROP_REQUIRED,
|
||||||
|
&value) < 0)
|
||||||
|
return -1;
|
||||||
|
|
||||||
|
def->kvm_features[feature] = value;
|
||||||
|
|
||||||
|
node = xmlNextElementSibling(node);
|
||||||
}
|
}
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
|
Loading…
Reference in New Issue
Block a user