On 2014/11/27 19:19, Gerd Hoffmann wrote: > On Do, 2014-11-27 at 19:16 +0800, Gonglei wrote: >> On 2014/11/27 19:04, Gerd Hoffmann wrote: >> >>> Hi, >>> >>>>> + evt = s->ptr.queue[(s->head+s->n) & QUEUE_MASK]; >>>> >>>> s->n is QUEUE_LENGTH, can we directly delete it? >>>> evt = s->ptr.queue[s->head & QUEUE_MASK] >>> >>> I prefer to make clear in the code that we want the last ring element >>> not the first and leave in the "+n", even if we could take it out. >>> >> OK. >> >> Another question, whether or not we handle this scenario >> before calling hid_set_next_idle(s) ? Maybe it is safer, because >> hid_idle_timer will call hid_pointer_event(), callback function >> of hs->event(hs). > > Not needed, the timer will not called before vmload is completely > finished. >
Yep, as the Qemu big lock. I will test this patch later, thanks for your work. :) Regards, -Gonglei