[Spice-devel] [spice v10 10/27] server: Make the RedDrawable refcount thread-safe

Frediano Ziglio fziglio at redhat.com
Fri Mar 4 10:10:01 UTC 2016


> On Thu, Mar 03, 2016 at 12:22:39PM -0500, Frediano Ziglio wrote:
> > 
> > No, Qemu must provide a thread safe release_resource.
> > Two reasons:
> > - release_resource is called from RedWorker which is a different
> >   thread than Qemu or other users (it's just created inside spice-server);
> > - I looked at Qemu code and there is a clear comment on this ;-) .
> 
> This is not how I understood this code when I looked at it, my
> understanding was that it's fine that the resource release comes from a
> different thread, but that it's expected to always come from the same
> RedWorker thread (I assume for a given QXL device). I did not read it as
> "this code is reentrant and can be called from any thread"
> 
> Looking at it again, the ring modification code in
> interface_release_resource in hw/display/qxl.c do not look like
> something that is thread-safe.
> 
> Christophe
> 

Yes, you are right, they access the same ring without any mutex.

Frediano


More information about the Spice-devel mailing list