]> git.proxmox.com Git - mirror_qemu.git/commitdiff
migration: not necessary to check ops again
authorWei Yang <richardw.yang@linux.intel.com>
Wed, 27 Mar 2019 01:31:30 +0000 (09:31 +0800)
committerDr. David Alan Gilbert <dgilbert@redhat.com>
Tue, 14 May 2019 16:33:35 +0000 (17:33 +0100)
During each iteration, se->ops is checked before each loop. So it is not
necessary to check it again and simplify the following check a little.

Signed-off-by: Wei Yang <richardw.yang@linux.intel.com>
Message-Id: <20190327013130.26259-1-richardw.yang@linux.intel.com>
Reviewed-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
Signed-off-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
migration/savevm.c

index 34bcad3807b0070ba684392266c1978a255f04ce..587fec8ce28881db0420aaca8df6ef491f9028ad 100644 (file)
@@ -1157,15 +1157,13 @@ int qemu_savevm_state_iterate(QEMUFile *f, bool postcopy)
         if (!se->ops || !se->ops->save_live_iterate) {
             continue;
         }
-        if (se->ops && se->ops->is_active) {
-            if (!se->ops->is_active(se->opaque)) {
-                continue;
-            }
+        if (se->ops->is_active &&
+            !se->ops->is_active(se->opaque)) {
+            continue;
         }
-        if (se->ops && se->ops->is_active_iterate) {
-            if (!se->ops->is_active_iterate(se->opaque)) {
-                continue;
-            }
+        if (se->ops->is_active_iterate &&
+            !se->ops->is_active_iterate(se->opaque)) {
+            continue;
         }
         /*
          * In the postcopy phase, any device that doesn't know how to