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 <pbonz...@redhat.com> > --- > 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 <owass...@redhat.com>
- [Qemu-devel] [PATCH 32/41] qemu-file: add writable socket Q... Paolo Bonzini
- Re: [Qemu-devel] [PATCH 32/41] qemu-file: add writable... Orit Wasserman
- Re: [Qemu-devel] [PATCH 32/41] qemu-file: add writ... Paolo Bonzini
- [Qemu-devel] [PATCH 10/41] migration: use qemu_file_set_err... Paolo Bonzini
- Re: [Qemu-devel] [PATCH 10/41] migration: use qemu_fil... Orit Wasserman
- [Qemu-devel] [PATCH 12/41] migration: do not nest flushing ... Paolo Bonzini
- Re: [Qemu-devel] [PATCH 12/41] migration: do not nest ... Orit Wasserman
- [Qemu-devel] [PATCH 14/41] migration: cleanup migration (in... Paolo Bonzini
- Re: [Qemu-devel] [PATCH 14/41] migration: cleanup migr... Orit Wasserman
- [Qemu-devel] [PATCH 04/41] migration: push qemu_savevm_stat... Paolo Bonzini
- Re: [Qemu-devel] [PATCH 04/41] migration: push qemu_sa... Orit Wasserman
- Re: [Qemu-devel] [PATCH 04/41] migration: push qemu_sa... Juan Quintela
- [Qemu-devel] [PATCH 01/41] migration: simplify while loop Paolo Bonzini
- Re: [Qemu-devel] [PATCH 01/41] migration: simplify whi... Orit Wasserman
- Re: [Qemu-devel] [PATCH 01/41] migration: simplify whi... Juan Quintela
- [Qemu-devel] [PATCH 11/41] migration: simplify error handli... Paolo Bonzini
- Re: [Qemu-devel] [PATCH 11/41] migration: simplify err... Orit Wasserman
- Re: [Qemu-devel] [PATCH 11/41] migration: simplify err... Juan Quintela
- Re: [Qemu-devel] [PATCH 11/41] migration: simplify... Paolo Bonzini
- Re: [Qemu-devel] [PATCH 11/41] migration: simplify err... Juan Quintela
- [Qemu-devel] [PATCH 35/41] migration: use QEMUFile for writ... Paolo Bonzini