On 25 janv. 2010, at 09:57, Liran Schour wrote: > > > Pierre Riteau <pierre.rit...@irisa.fr> wrote on 21/01/2010 20:03:32: > >> On 21 janv. 2010, at 16:24, Liran Schour wrote: >> >>> Move to stage3 only when remaining work can be done below max downtime. >>> >>> Changes from v1: remove max iterations. Try to infer storage >> performance and by that calculate remaining work. > ... >> >> I haven't read the patch in detail but I think we should be able to >> avoid duplicating code from vl.c by using qemu_get_clock. >> Also, is floating point really necessary? > > I thought that qemu_get_clock will return a value in 1000HZ (and that is > too low resolution). But now I see that I can use qemu_get_clock > (host_clock) and get nanoseconds resolution. I will switch it to > qemu_get_clock(host_clock) to avoid duplicating of code. > And I think we can avoid floating point here. > > Thanks for the review, > - Liran >
You probably don't want to use qemu_get_clock(host_clock): it calls get_clock_realtime(), which uses gettimeofday(). If the clock is modified by NTP, you could get wrong values. Instead, you could simply introduce code to get the value you want in nanoseconds. Paolo Bonzini has a patch for this in his tree: http://github.com/bonzini/qemu/commit/cbff458ad6a021582bfddb0f11c4628bbb2cd1e5 -- Pierre Riteau -- PhD student, Myriads team, IRISA, Rennes, France http://perso.univ-rennes1.fr/pierre.riteau/