From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:34184) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TF4im-0005B2-6R for qemu-devel@nongnu.org; Fri, 21 Sep 2012 11:00:49 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1TF4ih-0003DW-Py for qemu-devel@nongnu.org; Fri, 21 Sep 2012 11:00:48 -0400 Received: from mail-pb0-f45.google.com ([209.85.160.45]:34173) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TF4ih-0003DP-FT for qemu-devel@nongnu.org; Fri, 21 Sep 2012 11:00:43 -0400 Received: by pbbrp12 with SMTP id rp12so7868708pbb.4 for ; Fri, 21 Sep 2012 08:00:42 -0700 (PDT) Sender: Paolo Bonzini Message-ID: <505C8114.3050401@redhat.com> Date: Fri, 21 Sep 2012 17:00:36 +0200 From: Paolo Bonzini MIME-Version: 1.0 References: <1348236500-2565-1-git-send-email-quintela@redhat.com> <1348236500-2565-11-git-send-email-quintela@redhat.com> In-Reply-To: <1348236500-2565-11-git-send-email-quintela@redhat.com> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH 10/14] buffered_file: Unfold the trick to restart generating migration data List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Juan Quintela Cc: qemu-devel@nongnu.org Il 21/09/2012 16:08, Juan Quintela ha scritto: > This was needed before due to the way that the callbacks worked. > > Signed-off-by: Juan Quintela > --- > buffered_file.c | 17 ++++++++--------- > 1 file changed, 8 insertions(+), 9 deletions(-) > > diff --git a/buffered_file.c b/buffered_file.c > index 22b973f..f4a788d 100644 > --- a/buffered_file.c > +++ b/buffered_file.c > @@ -113,14 +113,6 @@ static int buffered_put_buffer(void *opaque, const uint8_t *buf, int64_t pos, in > return error; > } > > - if (pos == 0 && size == 0) { > - DPRINTF("file is ready\n"); > - if (s->bytes_xfer < s->xfer_limit) { > - DPRINTF("notifying client\n"); > - migrate_fd_put_ready(s->migration_state); > - } > - } > - > return size; > } > > @@ -215,8 +207,15 @@ static void *buffered_file_thread(void *opaque) > /* usleep expects microseconds */ > usleep((expire_time - current_time)*1000); > } > - buffered_put_buffer(s, NULL, 0, 0); > + buffered_flush(s); > + > + DPRINTF("file is ready\n"); > + if (s->bytes_xfer < s->xfer_limit) { > + DPRINTF("notifying client\n"); > + migrate_fd_put_ready(s->migration_state); > + } > } > + > g_free(s->buffer); > g_free(s); > return NULL; > Reviewed-by: Paolo Bonzini