Skip to contentSkip to conversation

migration: not necessary to check ops again

PATCH Dr. David Alan Gilbert 1 participant 1 message May 14, 2019 1 message not in the archive

lore
Share & tools
lore

A message that is not in the archive (sent off-list or not yet received): [email protected]

#1 lore raw
Quoted 4 lines · * Wei Yang ([email protected]) wrote:

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.

Queued

Quoted 34 lines
---
 migration/savevm.c | 14 ++++++--------
 1 file changed, 6 insertions(+), 8 deletions(-)
migration/savevm.c +6 -8
index 1415001d1c..5f0ca7fac2 100644
@@ -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
Signature · 1 line
2.19.1

--
Dr. David Alan Gilbert / [email protected] / Manchester, UK