migration/savevm: move non SaveStateEntry condition check out of iteration
in_postcopy and iterable_only are not SaveStateEntry specific, it would be more proper to check them out of iteration. Signed-off-by: Wei Yang <richardw.yang@linux.intel.com> Message-Id: <20190709140924.13291-4-richardw.yang@linux.intel.com> Reviewed-by: Dr. David Alan Gilbert <dgilbert@redhat.com> Signed-off-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
This commit is contained in:
parent
622a80c955
commit
e326767b45
@ -1247,8 +1247,7 @@ void qemu_savevm_state_complete_postcopy(QEMUFile *f)
|
|||||||
}
|
}
|
||||||
|
|
||||||
static
|
static
|
||||||
int qemu_savevm_state_complete_precopy_iterable(QEMUFile *f, bool in_postcopy,
|
int qemu_savevm_state_complete_precopy_iterable(QEMUFile *f, bool in_postcopy)
|
||||||
bool iterable_only)
|
|
||||||
{
|
{
|
||||||
SaveStateEntry *se;
|
SaveStateEntry *se;
|
||||||
int ret;
|
int ret;
|
||||||
@ -1257,7 +1256,6 @@ int qemu_savevm_state_complete_precopy_iterable(QEMUFile *f, bool in_postcopy,
|
|||||||
if (!se->ops ||
|
if (!se->ops ||
|
||||||
(in_postcopy && se->ops->has_postcopy &&
|
(in_postcopy && se->ops->has_postcopy &&
|
||||||
se->ops->has_postcopy(se->opaque)) ||
|
se->ops->has_postcopy(se->opaque)) ||
|
||||||
(in_postcopy && !iterable_only) ||
|
|
||||||
!se->ops->save_live_complete_precopy) {
|
!se->ops->save_live_complete_precopy) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
@ -1369,10 +1367,11 @@ int qemu_savevm_state_complete_precopy(QEMUFile *f, bool iterable_only,
|
|||||||
|
|
||||||
cpu_synchronize_all_states();
|
cpu_synchronize_all_states();
|
||||||
|
|
||||||
ret = qemu_savevm_state_complete_precopy_iterable(f, in_postcopy,
|
if (!in_postcopy || iterable_only) {
|
||||||
iterable_only);
|
ret = qemu_savevm_state_complete_precopy_iterable(f, in_postcopy);
|
||||||
if (ret) {
|
if (ret) {
|
||||||
return ret;
|
return ret;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (iterable_only) {
|
if (iterable_only) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user