Skip to content

Commit

Permalink
migration: push qemu_savevm_state_cancel out of qemu_savevm_state_*
Browse files Browse the repository at this point in the history
This is useful, because it lets us keep the cancellation callbacks
inside the big lock while pushing the others out.

Reviewed-by: Orit Wasserman <owasserm@redhat.com>
Reviewed-by: Juan Quintela <quintela@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Juan Quintela <quintela@redhat.com>
  • Loading branch information
bonzini authored and Juan Quintela committed Mar 11, 2013
1 parent 7a2c172 commit 04943eb
Showing 1 changed file with 4 additions and 11 deletions.
15 changes: 4 additions & 11 deletions savevm.c
Expand Up @@ -1621,17 +1621,11 @@ int qemu_savevm_state_begin(QEMUFile *f,

ret = se->ops->save_live_setup(f, se->opaque);
if (ret < 0) {
qemu_savevm_state_cancel();
return ret;
}
}
ret = qemu_file_get_error(f);
if (ret != 0) {
qemu_savevm_state_cancel();
}

return ret;

}

/*
Expand Down Expand Up @@ -1677,9 +1671,6 @@ int qemu_savevm_state_iterate(QEMUFile *f)
return ret;
}
ret = qemu_file_get_error(f);
if (ret != 0) {
qemu_savevm_state_cancel();
}
return ret;
}

Expand Down Expand Up @@ -1778,8 +1769,7 @@ static int qemu_savevm_state(QEMUFile *f)
};

if (qemu_savevm_state_blocked(NULL)) {
ret = -EINVAL;
goto out;
return -EINVAL;
}

ret = qemu_savevm_state_begin(f, &params);
Expand All @@ -1798,6 +1788,9 @@ static int qemu_savevm_state(QEMUFile *f)
if (ret == 0) {
ret = qemu_file_get_error(f);
}
if (ret != 0) {
qemu_savevm_state_cancel();
}

return ret;
}
Expand Down

0 comments on commit 04943eb

Please sign in to comment.