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

Christophe Fergeau cfergeau at redhat.com
Tue Jul 7 03:42:22 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;
>  #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;

Do we want to wrap the whole case PROP_REDIRECTING: in #ifdef so that we
get a warning if we try to use this property in a !USBREDIR binary?

Looks good to me either way.

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/b0317788/attachment.sig>


More information about the Spice-devel mailing list