Re: [Qemu-devel] [PATCH] ps2: set ps/2 output buffer size as the same as kernel

2014-04-24 Thread Gerd Hoffmann
Hi, > Move the check into ps2_mouse_send_packet() is not a good idea. > In that case, we cannot break the for loop except we change the return value > of ps2_mouse_send_packet(). Changing the return value is fine IMO. cheers, Gerd

Re: [Qemu-devel] [PATCH] ps2: set ps/2 output buffer size as the same as kernel

2014-04-24 Thread Gonglei (Arei)
Hi, Gerd. > > if (!(s->mouse_status & MOUSE_STATUS_REMOTE) && > > -(s->common.queue.count < (PS2_QUEUE_SIZE - 16))) { > > +(s->common.queue.count < PS2_QUEUE_SIZE)) { > > To me this looks like an attempt to make sure the queue has enough space > for the whole mouse message.

Re: [Qemu-devel] [PATCH] ps2: set ps/2 output buffer size as the same as kernel

2014-04-24 Thread Gonglei (Arei)
> Hi, > > > Move the check into ps2_mouse_send_packet() is not a good idea. > > In that case, we cannot break the for loop except we change the return value > > of ps2_mouse_send_packet(). > > Changing the return value is fine IMO. > OK. Change it in v3. Could you review the v2 about other cod

Re: [Qemu-devel] [PATCH] ps2: set ps/2 output buffer size as the same as kernel

2014-04-24 Thread Gonglei (Arei)
> Subject: Re: [PATCH] ps2: set ps/2 output buffer size as the same as kernel > > > @@ -137,7 +139,7 @@ void ps2_queue(void *opaque, int b) > > PS2State *s = (PS2State *)opaque; > > PS2Queue *q = &s->queue; > > > > -if (q->count >= PS2_QUEUE_SIZE) > > +if (q->count >= PS2_QUEUE_S

Re: [Qemu-devel] [PATCH] ps2: set ps/2 output buffer size as the same as kernel

2014-04-23 Thread Gerd Hoffmann
> @@ -137,7 +139,7 @@ void ps2_queue(void *opaque, int b) > PS2State *s = (PS2State *)opaque; > PS2Queue *q = &s->queue; > > -if (q->count >= PS2_QUEUE_SIZE) > +if (q->count >= PS2_QUEUE_SIZE - 1) Why? > if (!(s->mouse_status & MOUSE_STATUS_REMOTE) && > -(s->commo

[Qemu-devel] [PATCH] ps2: set ps/2 output buffer size as the same as kernel

2014-04-23 Thread arei.gonglei
From: Gonglei According to the PS/2 Mouse/Keyboard Protocol, the keyboard outupt buffer size is 16 bytes. And the PS2_QUEUE_SIZE 256 was introduced in Qemu from the very beginning. When I started a redhat5.6 32bit guest, meanwhile tapped the keyboard as quickly as possible, the screen would sh