[Spice-devel] [PATCH spice-server v3 2/5] red-channel-client: Make capabilities property write only

Christophe Fergeau cfergeau at redhat.com
Thu Mar 2 11:46:43 UTC 2017


On Thu, Mar 02, 2017 at 09:16:08AM +0000, Frediano Ziglio wrote:
> These properties are not read and code is broken (you would get
> uninitialized values).

Acked-by: Christophe Fergeau <cfergeau at redhat.com>

(maybe the more specific "the content of the array would be uninitialized"
rather than "you would get uninitialized values").



> 
> Signed-off-by: Frediano Ziglio <fziglio at redhat.com>
> ---
>  server/red-channel-client.c | 20 ++------------------
>  1 file changed, 2 insertions(+), 18 deletions(-)
> 
> diff --git a/server/red-channel-client.c b/server/red-channel-client.c
> index b583da2..2d2e3fd 100644
> --- a/server/red-channel-client.c
> +++ b/server/red-channel-client.c
> @@ -286,22 +286,6 @@ red_channel_client_get_property(GObject *object,
>          case PROP_MONITOR_LATENCY:
>              g_value_set_boolean(value, self->priv->monitor_latency);
>              break;
> -        case PROP_COMMON_CAPS:
> -            {
> -                GArray *arr = g_array_sized_new(FALSE, FALSE,
> -                                                sizeof(*self->priv->remote_caps.common_caps),
> -                                                self->priv->remote_caps.num_common_caps);
> -                g_value_take_boxed(value, arr);
> -            }
> -            break;
> -        case PROP_CAPS:
> -            {
> -                GArray *arr = g_array_sized_new(FALSE, FALSE,
> -                                                sizeof(*self->priv->remote_caps.caps),
> -                                                self->priv->remote_caps.num_caps);
> -                g_value_take_boxed(value, arr);
> -            }
> -            break;
>          default:
>              G_OBJECT_WARN_INVALID_PROPERTY_ID(object, property_id, pspec);
>      }
> @@ -454,7 +438,7 @@ static void red_channel_client_class_init(RedChannelClientClass *klass)
>                                "Common Capabilities",
>                                G_TYPE_ARRAY,
>                                G_PARAM_STATIC_STRINGS
> -                              | G_PARAM_READWRITE
> +                              | G_PARAM_WRITABLE
>                                | G_PARAM_CONSTRUCT_ONLY);
>      g_object_class_install_property(object_class, PROP_COMMON_CAPS, spec);
>  
> @@ -462,7 +446,7 @@ static void red_channel_client_class_init(RedChannelClientClass *klass)
>                                "Capabilities",
>                                G_TYPE_ARRAY,
>                                G_PARAM_STATIC_STRINGS
> -                              | G_PARAM_READWRITE
> +                              | G_PARAM_WRITABLE
>                                | G_PARAM_CONSTRUCT_ONLY);
>      g_object_class_install_property(object_class, PROP_CAPS, spec);
>  }
> -- 
> 2.9.3
> 
> _______________________________________________
> Spice-devel mailing list
> Spice-devel at lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/spice-devel
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 801 bytes
Desc: not available
URL: <https://lists.freedesktop.org/archives/spice-devel/attachments/20170302/8c422846/attachment.sig>


More information about the Spice-devel mailing list