[Spice-devel] [PATCH] migration: Don't assert() if MIGRATE_DATA comes before attaching the agent

Christophe Fergeau cfergeau at redhat.com
Tue Mar 25 09:44:02 PDT 2014


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
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 181 bytes
Desc: not available
URL: <http://lists.freedesktop.org/archives/spice-devel/attachments/20140325/715e27ad/attachment-0001.sig>


More information about the Spice-devel mailing list