[Spice-devel] [PATCH spice] server: Don't call vdagent chardev state callback on client (dis)connect

Hans de Goede hdegoede at redhat.com
Tue Jul 26 03:04:03 PDT 2011


Hi,

On 07/26/2011 11:57 AM, Alon Levy wrote:
> On Mon, Jul 25, 2011 at 12:20:52PM +0200, Hans de Goede wrote:
>> See this long mail for the rationale for this:
>> http://lists.freedesktop.org/archives/spice-devel/2011-July/004837.html
>> ---
>>   server/reds.c |   65 +++++++++++++++++---------------------------------------
>>   1 files changed, 20 insertions(+), 45 deletions(-)
>>
>
> ACK, just one comment.
>
>> diff --git a/server/reds.c b/server/reds.c
>> index e9694c0..7f45e46 100644
>> --- a/server/reds.c
>> +++ b/server/reds.c

<snip>

>> @@ -1105,7 +1086,7 @@ void reds_marshall_migrate_data_item(SpiceMarshaller *m, MainMigrateData *data)
>>
>>       data->version = MAIN_CHANNEL_MIG_DATA_VERSION;
>>
>> -    data->agent_connected = !!state->connected;
>> +    data->agent_connected = !!vdagent;
>>       data->client_agent_started = !state->write_filter.discard_all;
>>       data->num_client_tokens = state->num_client_tokens;
>>       data->send_tokens = ~0;
>> @@ -1324,13 +1305,13 @@ void reds_on_main_receive_migrate_data(MainMigrateData *data, uint8_t *end)
>>       state->num_tokens = REDS_AGENT_WINDOW_SIZE - state->num_client_tokens;
>>
>>       if (!data->agent_connected) {
>> -        if (state->connected) {
>> +        if (vdagent) {
>
> What's promising (reds->main_channel!=NULL)? because this is a reds_on_main_receive callback?
>

Yes, I actually first had a check for reds->main_channel!=NULL in there but removed that because
it seemed superfluous, and inconsistent with the reds_marshall_migrate_data_item code which
also only checks for vdagent.

>>               main_channel_push_agent_connected(reds->main_channel);
>>           }
>>           return;
>>       }
>>
>> -    if (!state->connected) {
>> +    if (!vdagent) {
>>           main_channel_push_agent_disconnected(reds->main_channel);
>>           return;
>>       }

<snip>

Regards,

Hans


More information about the Spice-devel mailing list