[Spice-devel] [PATCH v2 1/6] UsbDeviceManager add redirecting state

Christophe Fergeau cfergeau at redhat.com
Tue Jul 7 05:23:05 PDT 2015


On Mon, Jul 06, 2015 at 08:59:01PM +0300, Kirill Moizik wrote:
> add redirecting  property to UsbDeviceManager and expose get/set API
> 
> Signed-off-by: Kirill Moizik <kirill at daynix.com>
> ---
>  src/usb-device-manager.c | 28 ++++++++++++++++++++++++++++
>  1 file changed, 28 insertions(+)
> 
> diff --git a/src/usb-device-manager.c b/src/usb-device-manager.c
> index 5b8151f..1b334d3 100644
> --- a/src/usb-device-manager.c
> +++ b/src/usb-device-manager.c
> @@ -93,6 +93,7 @@ enum {
>      PROP_AUTO_CONNECT,
>      PROP_AUTO_CONNECT_FILTER,
>      PROP_REDIRECT_ON_CONNECT,
> +    PROP_REDIRECTING,
>  };
>  
>  enum
> @@ -130,6 +131,7 @@ struct _SpiceUsbDeviceManagerPrivate {
>      SpiceWinUsbDriver     *installer;
>  #endif
>      gboolean               use_usbclerk;
> +    gboolean               redirecting;
>  #endif
>      GPtrArray *devices;
>      GPtrArray *channels;
> @@ -241,6 +243,7 @@ static void spice_usb_device_manager_init(SpiceUsbDeviceManager *self)
>  #ifdef USE_USBREDIR
>      priv->devices  = g_ptr_array_new_with_free_func((GDestroyNotify)
>                                                      spice_usb_device_unref);
> +    priv->redirecting = FALSE;

Forgot to mention that this is not needed

>  #endif
>  }
>  
> @@ -421,6 +424,11 @@ static void spice_usb_device_manager_get_property(GObject     *gobject,
>      case PROP_REDIRECT_ON_CONNECT:
>          g_value_set_string(value, priv->redirect_on_connect);
>          break;
> +    case PROP_REDIRECTING:
> +#ifdef USE_USBREDIR
> +        g_value_set_boolean(value, priv->redirecting);
> +#endif
> +        break;
>      default:
>          G_OBJECT_WARN_INVALID_PROPERTY_ID(gobject, prop_id, pspec);
>          break;
> @@ -504,6 +512,11 @@ static void spice_usb_device_manager_set_property(GObject       *gobject,
>          priv->redirect_on_connect = g_strdup(filter);
>          break;
>      }
> +    case PROP_REDIRECTING:
> +#ifdef USE_USBREDIR
> +        priv->redirecting = g_value_get_boolean(value);
> +#endif
> +        break;
>      default:
>          G_OBJECT_WARN_INVALID_PROPERTY_ID(gobject, prop_id, pspec);
>          break;
> @@ -595,6 +608,21 @@ static void spice_usb_device_manager_class_init(SpiceUsbDeviceManagerClass *klas
>                                      pspec);
>  
>      /**
> +     * SpiceUsbDeviceManager:redirecting:
> +     *
> +     * Boolean variable specifying async usb redirection flow
> +     *
> +     * See #SpiceUsbDeviceManager:auto-connect-filter for the filter string
> +     * format.
> +     */
> +    pspec = g_param_spec_boolean("redirecting", "Redirecting",
> +                                 "Usb redirection in process",
> +                                 FALSE,
> +                                 G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS);

and that "USB redirection in progress" would be better.

Christophe
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 819 bytes
Desc: not available
URL: <http://lists.freedesktop.org/archives/spice-devel/attachments/20150707/f2902eb2/attachment.sig>


More information about the Spice-devel mailing list