qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH RFC] ps2: set the keybord output buffer size as


From: Gerd Hoffmann
Subject: Re: [Qemu-devel] [PATCH RFC] ps2: set the keybord output buffer size as the same as kernel
Date: Wed, 23 Apr 2014 16:10:49 +0200

  Hi,

> > >         if (++q->rptr == 256) {
> > >             q->rptr = 0;
> > >         }
> > >     }
> > 
> > That fails for the wraparound (rptr > wptr) case.
> > 
> Yep, it should use a temporary data array to transfer, which I have written
> in the previous email.

Saw it.  And this wraparound handling is also the reason why pre-save
needs to do this too.  You want qemu versions with both 16 and 256 bytes
buffer size interpret the vmstate stream correctly.  Therefore you
should write out the ring buffer in a state where the buffer size is not
needed to read it, i.e. where rptr + count < PS2_QUEUE_SIZE so you don't
need to wrap around.

cheers,
  Gerd





reply via email to

[Prev in Thread] Current Thread [Next in Thread]