1
0
mirror of https://gitlab.com/libvirt/libvirt.git synced 2025-03-07 17:28:15 +00:00

conf: Combine if condition in virDomainObjUpdateModificationImpact

Prior to commit id '3d021381' virDomainObjUpdateModificationImpact was
part of virDomainLiveConfigHelperMethod and the *flags if condition
VIR_DOMAIN_AFFECT_CONFIG checked the ->persistent boolean and made the
virDomainObjGetPersistentDef call.

Since the functions were split the ->persistent check is all that remained
and thus could be combined into one if statement.

Signed-off-by: Nikolay Shirokovskiy <nshirokovskiy@virtuozzo.com>
Signed-off-by: John Ferlan <jferlan@redhat.com>
This commit is contained in:
Nikolay Shirokovskiy 2016-02-24 11:38:36 +03:00 committed by John Ferlan
parent 751033a2e4
commit 9dc19806f6

View File

@ -2879,13 +2879,11 @@ virDomainObjUpdateModificationImpact(virDomainObjPtr vm,
return -1; return -1;
} }
if (*flags & VIR_DOMAIN_AFFECT_CONFIG) { if (!vm->persistent && (*flags & VIR_DOMAIN_AFFECT_CONFIG)) {
if (!vm->persistent) { virReportError(VIR_ERR_OPERATION_INVALID, "%s",
virReportError(VIR_ERR_OPERATION_INVALID, "%s", _("transient domains do not have any "
_("transient domains do not have any " "persistent config"));
"persistent config")); return -1;
return -1;
}
} }
return 0; return 0;