Re: [PATCH spice-server v2 1/2] test-stream-device: Better Qemu emulation for data reading

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

 



> 
> On Thu, Dec 07, 2017 at 08:47:38AM +0000, Frediano Ziglio wrote:
> > Qemu does not trigger a new data read if we don't read all data in
> > the buffer.
> > 
> > Signed-off-by: Frediano Ziglio <fziglio@xxxxxxxxxx>
> > ---
> >  server/stream-device.c            |  9 ++++++++
> >  server/tests/test-stream-device.c | 43
> >  +++++++++++++++++++++++++++++++++++++--
> >  2 files changed, 50 insertions(+), 2 deletions(-)
> > 
> > Changes since v1:
> > - avoid an inifinite loop, test added.
> > 
> > diff --git a/server/stream-device.c b/server/stream-device.c
> > index 4eaa959b..897fc665 100644
> > --- a/server/stream-device.c
> > +++ b/server/stream-device.c
> > @@ -123,6 +123,15 @@ stream_device_read_msg_from_dev(RedCharDevice *self,
> > SpiceCharDeviceInstance *si
> >          dev->hdr_pos = 0;
> >      }
> >  
> > +    if (handled || dev->has_error) {
> > +        // Qemu put the device on blocking state if we don't read all data
> > +        // so schedule another read.
> > +        // We arrive here if we processed that entire message or we
> > +        // got an error, try to read another message or discard the
> > +        // wrong data
> > +        red_char_device_wakeup(self);
> > +    }
> > +
> 
> This is supposed to be a commit changing test-stream-device.c, but there
> is this hunk in server/stream-device.c, is it intentional that it's
> there?
> 
> Christophe
> 

Yes, the change in stream-device.c handle the better emulation.
But apparently can be split (the path that leaded to this patch didn't make
this obvious).

Frediano
_______________________________________________
Spice-devel mailing list
Spice-devel@xxxxxxxxxxxxxxxxxxxxx
https://lists.freedesktop.org/mailman/listinfo/spice-devel




[Index of Archives]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Security]     [Bugtraq]     [Linux]     [Linux OMAP]     [Linux MIPS]     [ECOS]     [Asterisk Internet PBX]     [Linux API]     [Monitors]