[Spice-devel] [PATCH 07/13] server: add spice_server_char_device_remove_interface

Hans de Goede hdegoede at redhat.com
Tue Dec 7 02:21:34 PST 2010


Hi,

On 12/06/2010 05:16 PM, Alon Levy wrote:
> ---
>   server/reds.c |   21 ++++++++++++++++-----
>   1 files changed, 16 insertions(+), 5 deletions(-)
>
> diff --git a/server/reds.c b/server/reds.c
> index d71ecb1..517ac6d 100644
> --- a/server/reds.c
> +++ b/server/reds.c
> @@ -3463,6 +3463,21 @@ static int spice_server_char_device_add_interface(SpiceServer *s,
>       return 0;
>   }
>
> +static void spice_server_char_device_remove_interface(SpiceBaseInstance *sin)
> +{
> +    SpiceCharDeviceInstance* char_device =
> +            SPICE_CONTAINEROF(sin, SpiceCharDeviceInstance, base);
> +    SpiceCharDeviceInterface* sif;
> +
> +    sif = SPICE_CONTAINEROF(char_device->base.sif, SpiceCharDeviceInterface, base);

Unused variable sif (and it is not used in future patches either).

> +    red_printf("remove CHAR_DEVICE %s", char_device->subtype);
> +    if (strcmp(char_device->subtype, SUBTYPE_VDAGENT) == 0) {
> +        if (vdagent) {
> +            reds_agent_remove();
> +        }
> +    }
> +}
> +
>   __visible__ int spice_server_add_interface(SpiceServer *s,
>                                              SpiceBaseInstance *sin)
>   {
> @@ -3605,11 +3620,7 @@ __visible__ int spice_server_remove_interface(SpiceBaseInstance *sin)
>           snd_detach_record(SPICE_CONTAINEROF(sin, SpiceRecordInstance, base));
>
>       } else if (strcmp(interface->type, SPICE_INTERFACE_CHAR_DEVICE) == 0) {
> -        red_printf("remove SPICE_INTERFACE_CHAR_DEVICE");
> -        if (vdagent&&  sin ==&vdagent->base) {
> -            reds_agent_remove();
> -        }
> -
> +        spice_server_char_device_remove_interface(sin);
>       } else {
>           red_error("VD_INTERFACE_REMOVING unsupported");
>           return -1;

Regards,

Hans


More information about the Spice-devel mailing list