Re: [Qemu-devel] [PATCH 04/30] buffered_file: Move from using a timer to use a thread

2012-11-12 Thread Paolo Bonzini
Il 18/10/2012 09:30, Juan Quintela ha scritto: > @@ -160,11 +162,8 @@ static int buffered_close(void *opaque) > if (ret >= 0) { > ret = ret2; > } > -qemu_del_timer(s->timer); > -qemu_free_timer(s->timer); > -g_free(s->buffer); > -g_free(s); > - > +ret = migrat

Re: [Qemu-devel] [PATCH 04/30] buffered_file: Move from using a timer to use a thread

2012-10-21 Thread Orit Wasserman
On 10/18/2012 09:30 AM, Juan Quintela wrote: > We still protect everything except the wait with the iothread lock. > But we moved from a timer to a thread. Steps one by one. > > We also need to detect when we have finished with a variable "complete". > > Signed-off-by: Juan Quintela > --- > bu

Re: [Qemu-devel] [PATCH 04/30] buffered_file: Move from using a timer to use a thread

2012-10-18 Thread Paolo Bonzini
Il 18/10/2012 09:30, Juan Quintela ha scritto: > +} > +if (s->bytes_xfer >= s->xfer_limit) { > +/* usleep expects microseconds */ > +usleep((expire_time - current_time)*1000); > +} g_usleep please. Paolo

[Qemu-devel] [PATCH 04/30] buffered_file: Move from using a timer to use a thread

2012-10-18 Thread Juan Quintela
We still protect everything except the wait with the iothread lock. But we moved from a timer to a thread. Steps one by one. We also need to detect when we have finished with a variable "complete". Signed-off-by: Juan Quintela --- buffered_file.c | 58 +++---