[Spice-devel] [PATCH spice-server 2/2] QXL devices must be registered before Stream Devices

Jonathon Jongsma jjongsma at redhat.com
Wed Feb 13 14:27:45 UTC 2019


On Wed, 2019-02-13 at 09:19 -0500, Frediano Ziglio wrote:
> > 
> > Stream devices assume that all QXL devices are registered with the
> > server before we receive any communications from the stream device.
> > This
> > is due to the fact that QXL display channel IDs are assigned
> > directly
> > from the QXL device ID, whereas Stream display channels are
> > assigned
> > channel IDs based on the next free ID. If the stream channel is
> > created first, it will find that 0 is the first available display
> > ID and
> > use that for its channel ID. Then when QXL device #0 is registered,
> > it
> > will also create a display channel with channel ID 0, and they will
> > conflict.
> 
> Interesting, should not be checked somewhere and detected as API
> violation?
> 
> Frediano


Maybe. Right now qemu always registers QXL devices immediately after
qemu starts. And obviously we can't communicate via the stream device
until the guest is fully up and running. So I think there's essentially
no way for the bug to happen with current code. I think QXL channels
will always get created before stream channels. But for completeness it
probably would be good to add a check somewhere. 

The alternative is to disconnect the QXL ID from the channel ID. In
other words, QXL display channels would use the next available channel
ID (just like the stream channels do) instead of using the qxl->id as
the channel_id. But I don't know if such a change would violate any
other assumptions in the code.

Jonathon



More information about the Spice-devel mailing list