[Spice-devel] [PATCH 2/2] Revert "Remove use of opaque from vdi_port_read_one_msg_from_device"

Eduardo Lima (Etrunko) etrunko at redhat.com
Thu May 5 15:12:55 UTC 2016


On 05/05/2016 10:05 AM, Frediano Ziglio wrote:
>>
>> This reverts commit 0f947b425cc2219f3c5a8705f4214c2deb607a5b.
>> This patch causes bug as sin->st can be NULL in some cases.
>> opaque is always referring to RedsState.
>>
>> Signed-off-by: Frediano Ziglio <fziglio at redhat.com>
>> ---
> 
> It could be weird but I'm not sure this is the right fix to do.
> Why sin->st is reset in the first place?
> I think Qemu is possibly calling spice_remove_interface.
> I tried to came up with a patch:
> 
> diff --git a/server/reds.c b/server/reds.c
> index efd1429..cd1b2fc 100644
> --- a/server/reds.c
> +++ b/server/reds.c
> @@ -3266,6 +3266,7 @@ static void spice_server_char_device_remove_interface(RedsState *reds, SpiceBase
>      if (strcmp(char_device->subtype, SUBTYPE_VDAGENT) == 0) {
>          if (reds->vdagent) {
>              reds_agent_remove(reds);
> +            red_char_device_reset_dev_instance(RED_CHAR_DEVICE(reds->vdagent), NULL);
>          }
>      }
>  #ifdef USE_SMARTCARD
> 
> 
> but in the added line reds->vdagent is already set to NULL (by reds_agent_remove).
> 
> Sorry... I just realized the mistake... thank to the (missing) type system...
> the line should be
> 
>    red_char_device_reset_dev_instance(RED_CHAR_DEVICE(reds->agent_dev), NULL);
> 
> Frediano
> 

I ran a new round of tests and I can confirm that this new one fixes the
problem without the need to revert the original patch.

-- 
Eduardo de Barros Lima (Etrunko)
Software Engineer - RedHat
etrunko at redhat.com


More information about the Spice-devel mailing list