[Spice-devel] [PATCH spice-gtk 1/6] usbredir: Add device rejected errors

Marc-André Lureau marcandre.lureau at gmail.com
Wed Feb 22 04:50:58 PST 2012


On Tue, Feb 21, 2012 at 3:12 PM, Hans de Goede <hdegoede at redhat.com> wrote:
> diff --git a/gtk/channel-usbredir.c b/gtk/channel-usbredir.c
> +    /**
> +     * SpiceUsbredirChannel::device-error:
> +     * @channel: #SpiceUsbredirChannel that emitted the signal
> +     * @device:  #SpiceUsbDevice boxed object corresponding to the device which has an error
> +     * @error:   #GError describing the error
> +     *
> +     * The #SpiceUsbredirChannel::device-error signal is emitted whenever an
> +     * error happens which causes a device to no longer be available to the
> +     * guest.
> +     **/
> +    signals[DEVICE_ERROR] =
> +        g_signal_new("device-error",
> +                     G_OBJECT_CLASS_TYPE(gobject_class),
> +                     G_SIGNAL_RUN_FIRST,
> +                     G_STRUCT_OFFSET(SpiceUsbredirChannelClass, device_error),
> +                     NULL, NULL,
> +                     g_cclosure_user_marshal_VOID__BOXED_BOXED,
> +                     G_TYPE_NONE,
> +                     2,
> +                     SPICE_TYPE_USB_DEVICE,
> +                     G_TYPE_ERROR);

I am a bit puzzled with those 2 device-error signals on the channel
and the manager. It sounds confusing. Since the manager is the primary
interface, and we are not really concern about which channel is used
when redirection failed, shouldn't the channel just call a manager
private method or it can directly emit the manager signal? That would
avoid having to add 2 similar and thus confusing public API, and would
also simplify a bit the code, not having to proxy signals.

The rest of the patch looks fine.

-- 
Marc-André Lureau


More information about the Spice-devel mailing list