From 9dc19806f649fbdcb5d4dfda0ed0e3a79aa1c190 Mon Sep 17 00:00:00 2001 From: Nikolay Shirokovskiy Date: Wed, 24 Feb 2016 11:38:36 +0300 Subject: [PATCH] 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 Signed-off-by: John Ferlan --- src/conf/domain_conf.c | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c index 39451edf41..8bfe895d5c 100644 --- a/src/conf/domain_conf.c +++ b/src/conf/domain_conf.c @@ -2879,13 +2879,11 @@ virDomainObjUpdateModificationImpact(virDomainObjPtr vm, return -1; } - if (*flags & VIR_DOMAIN_AFFECT_CONFIG) { - if (!vm->persistent) { - virReportError(VIR_ERR_OPERATION_INVALID, "%s", - _("transient domains do not have any " - "persistent config")); - return -1; - } + if (!vm->persistent && (*flags & VIR_DOMAIN_AFFECT_CONFIG)) { + virReportError(VIR_ERR_OPERATION_INVALID, "%s", + _("transient domains do not have any " + "persistent config")); + return -1; } return 0; -- 2.39.5