On 30 Oct 2013, at 00:44, Xiexiangyou wrote: > But I want to know why alarm timer will make the problem, is the reason that > losing the alarm event?
I am not sure it was the use of alarm timers per se - doubtless it would be possible to write code that worked 100% using alarm timers. The old code had accumulated over years and had grown somewhat crufty - no one's fault in particular - so there were various inconsistencies relating to edge cases (infinite timeouts, no timers running, no FDs, >UINT32_MAX timeouts etc). I just remember seeing several times bits of code that made me think "I wonder if and how that can ever work in situation X" and not investigating further as the replacement code was generic enough to work in all situations. And if there were bugs in the alarm timer bit they will simply have been deleted when I deleted several hundred lines of qemu-timer.c. Sometimes a rewrite just fixes stuff without any particular bug-hunting skill on the part of the author. -- Alex Bligh