[Spice-devel] [PATCH spice-gtk] usbredir: Add support for filtering out devices from auto-redirection

Hans de Goede hdegoede at redhat.com
Thu Jan 12 06:32:56 PST 2012


Hi,

On 01/12/2012 09:58 AM, Christophe Fergeau wrote:

<snip>

>>           break;
>> +    case PROP_AUTO_CONNECT_FILTER: {
>> +#ifdef USE_USBREDIR
>> +        const gchar *filter = g_value_get_string(value);
>> +        struct usbredirfilter_rule *rules;
>> +        int r, count;
>> +
>> +        r = usbredirfilter_string_to_rules(filter, ",", "|",&rules,&count);
>> +        if (r) {
>> +            if (r == -ENOMEM)
>> +                g_error("Failed to allocate memory for auto-connect-filter");
>> +            g_warning("Error parsing auto-connect-filter string, keeping old filter\n");
>> +            break;
>> +        }
>> +
>> +        g_free(priv->auto_connect_filter);
>> +        free(priv->auto_conn_filter_rules);
>> +
>> +        priv->auto_connect_filter = g_strdup(filter);
>> +        priv->auto_conn_filter_rules = rules;
>> +        priv->auto_conn_filter_rules_count = count;
>> +#else
>> +        priv->auto_connect_filter = g_value_get_string(value);
>
> I'd dup this string, it will probably go away after the property setting is
> over.

Good one, new version coming up.

Regards,

Hans


More information about the Spice-devel mailing list