[Spice-devel] [PATCH spice-gtk] usb-redir: Fix read error handling depending on SpiceUsbDevice == libusb_device

Christophe Fergeau cfergeau at redhat.com
Tue Oct 9 01:07:57 PDT 2012


On Tue, Oct 09, 2012 at 12:10:41AM +0200, Hans de Goede wrote:
> This has not been true for a while now, but since getting an error return
> from usbredirhost_read_guest_data() is rare no one has tripped over this
> sofar.
> 
> Signed-off-by: Hans de Goede <hdegoede at redhat.com>
> ---
>  gtk/channel-usbredir-priv.h   |  1 +
>  gtk/channel-usbredir.c        | 29 +++++++++++++++++++----------
>  gtk/usb-device-manager-priv.h |  2 +-
>  gtk/usb-device-manager.c      | 24 +++---------------------
>  4 files changed, 24 insertions(+), 32 deletions(-)
> 
> diff --git a/gtk/usb-device-manager.c b/gtk/usb-device-manager.c
> index 6358da8..229b590 100644
> --- a/gtk/usb-device-manager.c
> +++ b/gtk/usb-device-manager.c
> @@ -155,9 +155,6 @@ static void  spice_usb_device_set_state(SpiceUsbDevice *device, guint8 s);
>  
>  static gboolean spice_usb_device_equal_libdev(SpiceUsbDevice *device,
>                                                libusb_device *libdev);
> -static SpiceUsbDevice *
> -spice_usb_device_manager_libdev_to_device(SpiceUsbDeviceManager *self,
> -                                          libusb_device *libdev);
>  static libusb_device *
>  spice_usb_device_manager_device_to_libdev(SpiceUsbDeviceManager *self,
>                                            SpiceUsbDevice *device);
> @@ -920,14 +917,10 @@ void spice_usb_device_manager_stop_event_listening(
>  }
>  
>  void spice_usb_device_manager_device_error(
> -    SpiceUsbDeviceManager *self, libusb_device *libdev, GError *err)
> +    SpiceUsbDeviceManager *self, SpiceUsbDevice *device, GError *err)
>  {
> -    SpiceUsbDevice *device;
> -
>      g_return_if_fail(SPICE_IS_USB_DEVICE_MANAGER(self));
> -    g_return_if_fail(libdev != 0);
> -
> -    device = spice_usb_device_manager_libdev_to_device(self, libdev);
> +    g_return_if_fail(device != 0);

Nit: != NULL would be better

ACK

Christophe
-------------- 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/20121009/12a024d7/attachment-0001.pgp>


More information about the Spice-devel mailing list