[Spice-devel] [PATCH 28/35] vdi port: redesign.

Alon Levy alevy at redhat.com
Tue May 18 02:15:38 PDT 2010

----- "Gerd Hoffmann" <kraxel at redhat.com> wrote:

> Hi,
> > I'm not sure how that should be done. My main dislike of the current
> interface
> > is that it forces either a copy from the driver to an intermediate,
> like
> > the code I had checked in, or it forces spice-server to consume
> everything it gets.
> No, it isn't all or nothing.  You can delay the intermediate copy
> until 
> the wakeup() call returns, then only copy in case the server didn't 
> consume all data.

cool, that's a good idea.

> I'm not sure this is worth the trouble though.  With bulky data we 
> likely have to throttle (and thus copy) frequently anyway.  With 
> low-bandwith data the extra copy doesn't hurt much.

see note below.

> > The other is to have a havedata callback instead of read, called
> from driver,
> > allow the havedata to return a boolean telling it if to throttle or
> not, and
> > have another "unthrottle" function called from spice.
> >   - change of API
> >   + no additional copy of data
> Yes, you need an additional interface for throttle/unthrottle then. 
> Works too.  I don't mind much which way we pick.

Two notes:

 * I need to check with virtio-serial, but it seems to me that when we
throttle we should be able to access the pointer provided by havedata.
 That would reduce the copying to zero. It would require being careful
 about it.

 * Throttling is two way I think - so we can't continue sending while
throttling incoming data (need to check this too). If this is the case,
we may need an extra device for clipboard after all.

> cheers,
>    Gerd

More information about the Spice-devel mailing list