On 02/15/2013 07:46 PM, Paolo Bonzini wrote: > Unify the goto around the loop, with the exit condition at the end of it. > Both can be expressed as "while (ret >= 0)". > > Signed-off-by: Paolo Bonzini <pbonz...@redhat.com> > --- > migration.c | 11 +---------- > 1 files changed, 1 insertions(+), 10 deletions(-) > > diff --git a/migration.c b/migration.c > index b1ebb01..5414060 100644 > --- a/migration.c > +++ b/migration.c > @@ -665,14 +665,9 @@ static void *buffered_file_thread(void *opaque) > qemu_mutex_lock_iothread(); > DPRINTF("beginning savevm\n"); > ret = qemu_savevm_state_begin(s->file, &s->params); > - if (ret < 0) { > - DPRINTF("failed, %d\n", ret); > - qemu_mutex_unlock_iothread(); > - goto out; > - } > qemu_mutex_unlock_iothread(); > > - while (true) { > + while (ret >= 0) { > int64_t current_time = qemu_get_clock_ms(rt_clock); > uint64_t pending_size; > > @@ -745,12 +740,8 @@ static void *buffered_file_thread(void *opaque) > g_usleep((initial_time + BUFFER_DELAY - current_time)*1000); > } > ret = buffered_flush(s); > - if (ret < 0) { > - break; > - } > } > > -out: > if (ret < 0) { > migrate_fd_error(s); > } >
Reviewed-by: Orit Wasserman <owass...@redhat.com>