[Spice-devel] [PATCH spice-server v2 2/2] stream-device: Implements properly device reset on open/close

Christophe Fergeau cfergeau at redhat.com
Wed Jan 10 17:13:27 UTC 2018


On Thu, Dec 07, 2017 at 08:47:39AM +0000, Frediano Ziglio wrote:
> Due to the way Qemu handle the device we must consume all pending
> data inside the callback to read data from the device.

Any idea if QEMU can be fixed to do the right thing? We'll still need
some kind of workaround to deal with older QEMUs, but might be nicer
if newer QEMUs don't have this limitation. It was not clear to me if the
limitation comes from chardev/spice.c or from a more generic QEMU layer.
I would say "inside the stream_device_read_msg_from_dev() callback"
rather than "inside the callback to read data from the device"

> We need to consume all data from previous device dialog to avoid

s/dialog/communication maybe?

> that next device usage is still seeing old data.

> This as Qemu return 0 if you call SpiceCharDeviceInterface::read
> outside this callback (which is called by Qemu using
> spice_server_char_device_wakeup).

"This needs to be done within this callback, as QEMU returns 0 if you
call SpiceCharDeviceInterface::read() outside of it"? "QEMU invokes this
callback through a call to spice_server_char_device_wakeup"

> Also to communicate the error and avoiding to have to read any data the
> guest want to write disable the device.

I'm not sure what you mean here.

Christophe
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: not available
URL: <https://lists.freedesktop.org/archives/spice-devel/attachments/20180110/9245ab35/attachment.sig>


More information about the Spice-devel mailing list