----- "Alexander Larsson" <[email protected]> wrote:

> On Wed, 2010-08-25 at 06:28 -0400, Alon Levy wrote:
> > ----- Forwarded Message -----
> > From: "Alon Levy" <[email protected]>
> > To: [email protected]
> > Sent: Sunday, August 22, 2010 10:28:37 PM (GMT+0200) Auto-Detected
> > Subject: [PATCH 2/3] server: fix race when data arrives from guest
> through vdi interface
> > 
> > The call chains that could lead to write_to_vdi_port from two
> threads:
> > 
> > guest paste:
> >  per cpu thread:
> >  kvm_main_loop_cpu..vmc_have_data..spice_server_vdi_port_wakeup
> >   ..write_to_vdi_port
> 
> Is this enough though?
> 
> It seems to me that read_from_vdi_port() is not threadsafe either. It
> changes some state and does not seem to have any locking or anything.

Yes, that's true. Experimentally the patch provided fixes the problems we
had, (driver stuck on read, agent crash) but you're right that 
read_from_vdi_port
is being called from two threads. It could be fixed by adding a notification to 
get
the parsing (and all state changing code) to run in the main thread, and 
buffering
it only in the callback from the cpu thread.
_______________________________________________
Spice-devel mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/spice-devel

Reply via email to