Hey, On Tue, Mar 18, 2014 at 01:06:20PM +0200, Uri Lublin wrote: > > Hi Christophe, > > I'm concerned that reds_agent_state_restore() is called after > spice_char_device_start() I think the position for the call to reds_agent_state_restore() was quite arbitrary and that I should be able to move it before the call to spice_char_device_start(). > > Also I'm not sure how this patch solves the race. > This patch moves the call to reds_agent_state_restore() from > attach_to_red_agent() > into spice_server_char_device_add_interface(). But > attach_to_red_agent is only called > from spice_server_char_devices_add_interface. Maybe 'race' is a bad word for what I'm trying to fix. You can either get a MIGRATE_DATA message from the client, and then have spice_server_char_devices_add_interface() getting called, or you can have a call to spice_server_char_devices_add_interface() and then receive the MIGRATE_DATA client message. The latter situation is the common case, but you can sometimes hit the former, and the current code does not deal gracefully with it as an assert is triggered. This commit changes attach_to_red_agent() in order so that char device state is the one expected by spice_char_device_state_restore(). Maybe the asserts in spice_char_device_state_restore() should be changed instead, this is the part I'm not familiar with. Christophe
Attachment:
pgpgfiJfSl_gj.pgp
Description: PGP signature
_______________________________________________ Spice-devel mailing list Spice-devel@xxxxxxxxxxxxxxxxxxxxx http://lists.freedesktop.org/mailman/listinfo/spice-devel