Igor Mitsyanko <i.mitsya...@gmail.com> wrote: > On 6/28/2012 11:22 PM, Juan Quintela wrote: >> Enable the creation of a method to tell migration if that section is >> active and should be migrate. We use it for blk-migration, that is >> normally not active. We don't create the method for RAM, as setups >> without RAM are very strange O:-) >> >> Signed-off-by: Juan Quintela <quint...@redhat.com> >> @@ -1576,6 +1576,11 @@ int qemu_savevm_state_begin(QEMUFile *f, >> if (!se->ops || !se->ops->save_live_state) { >> continue; >> } >> + if (se->ops && se->ops->is_active) { >> + if (!se->ops->is_active(se->opaque)) { > > If we got here then we know for sure that se->ops != NULL,and then > nested condition could be simplified to if (se->ops->is_active && > !se->ops->is_active(se->opaque)). Same for qemu_savevm_state_iterate() > amd qemu_savevm_state_complete()
I tried to maintain consistency with the previous test, i.e. all have the same structure. I am still not sure which one is better :-() The approach that I did put the things in the same order, yours, remove two lines and one && operand. Will think about that one, thanks. Later, Juan.