]> xenbits.xensource.com Git - libvirt.git/commitdiff
conf: Combine if condition in virDomainObjUpdateModificationImpact
authorNikolay Shirokovskiy <nshirokovskiy@virtuozzo.com>
Wed, 24 Feb 2016 08:38:36 +0000 (11:38 +0300)
committerJohn Ferlan <jferlan@redhat.com>
Tue, 1 Mar 2016 15:41:53 +0000 (10:41 -0500)
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>
src/conf/domain_conf.c

index 39451edf4135e29ef149236c880cb9894a3728a5..8bfe895d5ce5ee473f8709592f2e7bec296ded84 100644 (file)
@@ -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;