[Spice-devel] [PATCH spice-gtk 1/5] Rename spice-usbredir-filter option to spice-usbredir-auto-redirect-filter

Christophe Fergeau cfergeau at redhat.com
Fri Sep 28 12:18:06 PDT 2012


On Fri, Sep 21, 2012 at 05:32:21PM +0200, Hans de Goede wrote:
> The spice-usbredir-filter cmdline option was not chosen well, as it does
> not indicate what it filters. Now that we are also getting a filter for
> selecting already plugged in devices to redirect when a spice connection gets
> established, it needs to be renamed to make its function more clear.

This is some kind of ABI break as scripts using the old option name will be
broken. You don't seem to be reusing the old name for something else in
this series, so maybe we can keep it and output a deprecation warning when
it's used for now? On the other hand, this option is probably not widely
used, so maybe breaking things now will not be too bad...
https://bugzilla.redhat.com/show_bug.cgi?format=multiple&id=823541 seems to
indicate there's at least one user of it.

Christophe

> 
> Signed-off-by: Hans de Goede <hdegoede at redhat.com>
> ---
>  gtk/spice-option.c | 11 ++++++-----
>  1 file changed, 6 insertions(+), 5 deletions(-)
> 
> diff --git a/gtk/spice-option.c b/gtk/spice-option.c
> index 715e84a..1333766 100644
> --- a/gtk/spice-option.c
> +++ b/gtk/spice-option.c
> @@ -32,7 +32,7 @@ static char *ca_file = NULL;
>  static char *host_subject = NULL;
>  static char *smartcard_db = NULL;
>  static char *smartcard_certificates = NULL;
> -static char *usbredir_filter = NULL;
> +static char *usbredir_auto_redirect_filter = NULL;
>  static gboolean smartcard = FALSE;
>  static gboolean disable_audio = FALSE;
>  static gboolean disable_usbredir = FALSE;
> @@ -131,8 +131,8 @@ GOptionGroup* spice_get_option_group(void)
>            N_("Path to the local certificate database to use for software smartcard certificates"), N_("<certificate-db>") },
>          { "spice-disable-usbredir", '\0', 0, G_OPTION_ARG_NONE, &disable_usbredir,
>            N_("Disable USB redirection support"), NULL },
> -        { "spice-usbredir-filter", '\0', 0, G_OPTION_ARG_STRING, &usbredir_filter,
> -          N_("Filter for excluding USB devices from auto redirection"), N_("<filter-string>") },
> +        { "spice-usbredir-auto-redirect-filter", '\0', 0, G_OPTION_ARG_STRING, &usbredir_auto_redirect_filter,
> +          N_("Filter selecting USB devices to be auto-redirected when plugged in"), N_("<filter-string>") },
>          { "spice-cache-size", '\0', 0, G_OPTION_ARG_INT, &cache_size,
>            N_("Image cache size"), N_("<bytes>") },
>          { "spice-glz-window-size", '\0', 0, G_OPTION_ARG_INT, &glz_window_size,
> @@ -195,10 +195,11 @@ void spice_set_session_option(SpiceSession *session)
>          if (smartcard_db)
>              g_object_set(session, "smartcard-db", smartcard_db, NULL);
>      }
> -    if (usbredir_filter) {
> +    if (usbredir_auto_redirect_filter) {
>          SpiceUsbDeviceManager *m = spice_usb_device_manager_get(session, NULL);
>          if (m)
> -            g_object_set(m, "auto-connect-filter", usbredir_filter, NULL);
> +            g_object_set(m, "auto-connect-filter",
> +                         usbredir_auto_redirect_filter, NULL);
>      }
>      if (disable_usbredir)
>          g_object_set(session, "enable-usbredir", FALSE, NULL);
> -- 
> 1.7.12
> 
> _______________________________________________
> Spice-devel mailing list
> Spice-devel at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/spice-devel
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 198 bytes
Desc: not available
URL: <http://lists.freedesktop.org/archives/spice-devel/attachments/20120928/11a64e20/attachment.pgp>


More information about the Spice-devel mailing list