Re: [Qemu-devel] [RFC PATCH] tests: replace rem = sleep(time) with g_timer

2019-01-11 Thread Alex Bennée
Greg Kurz writes: > On Fri, 11 Jan 2019 16:41:41 +0100 > Paolo Bonzini wrote: > >> On 11/01/19 16:28, Alex Bennée wrote: >> >> Why not g_usleep? It already does a while loop around nanosleep (which >> >> returns the remaining time in the wait, like select but unlike sleep and >> >> poll). >>

Re: [Qemu-devel] [RFC PATCH] tests: replace rem = sleep(time) with g_timer

2019-01-11 Thread Eduardo Habkost
On Fri, Jan 11, 2019 at 04:06:54PM +, Alex Bennée wrote: > > Paolo Bonzini writes: > > > On 11/01/19 16:28, Alex Bennée wrote: > >>> Why not g_usleep? It already does a while loop around nanosleep (which > >>> returns the remaining time in the wait, like select but unlike sleep and > >>>

Re: [Qemu-devel] [RFC PATCH] tests: replace rem = sleep(time) with g_timer

2019-01-11 Thread Greg Kurz
On Fri, 11 Jan 2019 16:41:41 +0100 Paolo Bonzini wrote: > On 11/01/19 16:28, Alex Bennée wrote: > >> Why not g_usleep? It already does a while loop around nanosleep (which > >> returns the remaining time in the wait, like select but unlike sleep and > >> poll). > > Yeah I'm testing that now.

Re: [Qemu-devel] [RFC PATCH] tests: replace rem = sleep(time) with g_timer

2019-01-11 Thread Alex Bennée
Paolo Bonzini writes: > On 11/01/19 16:28, Alex Bennée wrote: >>> Why not g_usleep? It already does a while loop around nanosleep (which >>> returns the remaining time in the wait, like select but unlike sleep and >>> poll). >> Yeah I'm testing that now. However I have managed to trigger: >>

Re: [Qemu-devel] [RFC PATCH] tests: replace rem = sleep(time) with g_timer

2019-01-11 Thread Alex Bennée
Paolo Bonzini writes: > On 11/01/19 16:28, Alex Bennée wrote: >>> Why not g_usleep? It already does a while loop around nanosleep (which >>> returns the remaining time in the wait, like select but unlike sleep and >>> poll). >> Yeah I'm testing that now. However I have managed to trigger: >>

Re: [Qemu-devel] [RFC PATCH] tests: replace rem = sleep(time) with g_timer

2019-01-11 Thread Paolo Bonzini
On 11/01/19 16:28, Alex Bennée wrote: >> Why not g_usleep? It already does a while loop around nanosleep (which >> returns the remaining time in the wait, like select but unlike sleep and >> poll). > Yeah I'm testing that now. However I have managed to trigger: > >

Re: [Qemu-devel] [RFC PATCH] tests: replace rem = sleep(time) with g_timer

2019-01-11 Thread Alex Bennée
Paolo Bonzini writes: > On 11/01/19 15:38, Alex Bennée wrote: >> Relying on sleep to always return having slept isn't safe as a signal >> may have occurred. If signals are constantly incoming the program will >> never reach it's termination condition. This is believed to be the >> mechanism

Re: [Qemu-devel] [RFC PATCH] tests: replace rem = sleep(time) with g_timer

2019-01-11 Thread Paolo Bonzini
On 11/01/19 15:38, Alex Bennée wrote: > Relying on sleep to always return having slept isn't safe as a signal > may have occurred. If signals are constantly incoming the program will > never reach it's termination condition. This is believed to be the > mechanism causing time outs for qht-test in