[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH 04/41] migration: push qemu_savevm_state_cancel
From: |
Orit Wasserman |
Subject: |
Re: [Qemu-devel] [PATCH 04/41] migration: push qemu_savevm_state_cancel out of qemu_savevm_state_* |
Date: |
Mon, 18 Feb 2013 11:15:43 +0200 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20130110 Thunderbird/17.0.2 |
On 02/15/2013 07:46 PM, Paolo Bonzini wrote:
> This is useful, because it lets us keep the cancellation callbacks
> inside the big lock while pushing the others out.
>
> Signed-off-by: Paolo Bonzini <address@hidden>
> ---
> savevm.c | 15 ++++-----------
> 1 files changed, 4 insertions(+), 11 deletions(-)
>
> diff --git a/savevm.c b/savevm.c
> index a8a53ef..4302903 100644
> --- a/savevm.c
> +++ b/savevm.c
> @@ -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;
> -
> }
>
> /*
> @@ -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;
> }
>
> @@ -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, ¶ms);
> @@ -1798,6 +1788,9 @@ out:
> if (ret == 0) {
> ret = qemu_file_get_error(f);
> }
> + if (ret != 0) {
> + qemu_savevm_state_cancel();
> + }
>
> return ret;
> }
>
Reviewed-by: Orit Wasserman <address@hidden>
- [Qemu-devel] [PATCH 01/41] migration: simplify while loop, (continued)
- [Qemu-devel] [PATCH 01/41] migration: simplify while loop, Paolo Bonzini, 2013/02/15
- [Qemu-devel] [PATCH 02/41] migration: always use vm_stop_force_state, Paolo Bonzini, 2013/02/15
- [Qemu-devel] [PATCH 03/41] migration: move more error handling to migrate_fd_cleanup, Paolo Bonzini, 2013/02/15
- [Qemu-devel] [PATCH 04/41] migration: push qemu_savevm_state_cancel out of qemu_savevm_state_*, Paolo Bonzini, 2013/02/15
- [Qemu-devel] [PATCH 05/41] block-migration: remove useless calls to blk_mig_cleanup, Paolo Bonzini, 2013/02/15
- [Qemu-devel] [PATCH 07/41] migration: use qemu_file_set_error to pass error codes back to qemu_savevm_state, Paolo Bonzini, 2013/02/15
- [Qemu-devel] [PATCH 09/41] migration: flush all data to fd when buffered_flush is called, Paolo Bonzini, 2013/02/15