[Spice-devel,spice-gtk,Win32,v3,09/12] usb-device-manager: warn if a device to remove was not found

Submitted by Uri Lublin on June 28, 2012, 1:46 a.m.

Details

Message ID 1340848001-7791-10-git-send-email-uril@redhat.com
State New
Headers show

Not browsing as part of any series.

Commit Message

Uri Lublin June 28, 2012, 1:46 a.m.
Also changed a bit the warning text on device-add to differentiate the two.
---
 gtk/usb-device-manager.c |    8 ++++++--
 1 files changed, 6 insertions(+), 2 deletions(-)

Patch hide | download patch | download mbox

diff --git a/gtk/usb-device-manager.c b/gtk/usb-device-manager.c
index 8340335..d4740cf 100644
--- a/gtk/usb-device-manager.c
+++ b/gtk/usb-device-manager.c
@@ -602,7 +602,7 @@  static void spice_usb_device_manager_add_dev(SpiceUsbDeviceManager  *self,
         libusb_free_device_list(dev_list, 1);

     if (!device) {
-        g_warning("Could not find USB device at busnum %d devaddr %d",
+        g_warning("Could not find USB device to add at busnum %d devaddr %d",
                   bus, address);
         return;
     }
@@ -646,8 +646,12 @@  static void spice_usb_device_manager_remove_dev(SpiceUsbDeviceManager  *self,
             break;
         }
     }
-    if (!device)
+
+    if (!device) {
+        g_warning("Could not find USB device to remove at busnum %d devaddr %d",
+                  bus, address);
         return;
+    }

     spice_usb_device_manager_disconnect_device(self, (SpiceUsbDevice *)device);


Comments

ack

Uri Lublin wrote:
> Also changed a bit the warning text on device-add to differentiate the two.
> ---
>  gtk/usb-device-manager.c |    8 ++++++--
>  1 files changed, 6 insertions(+), 2 deletions(-)
>
> diff --git a/gtk/usb-device-manager.c b/gtk/usb-device-manager.c
> index 8340335..d4740cf 100644
> --- a/gtk/usb-device-manager.c
> +++ b/gtk/usb-device-manager.c
> @@ -602,7 +602,7 @@ static void spice_usb_device_manager_add_dev(SpiceUsbDeviceManager  *self,
>          libusb_free_device_list(dev_list, 1);
>
>      if (!device) {
> -        g_warning("Could not find USB device at busnum %d devaddr %d",
> +        g_warning("Could not find USB device to add at busnum %d devaddr %d",
>                    bus, address);
>          return;
>      }
> @@ -646,8 +646,12 @@ static void spice_usb_device_manager_remove_dev(SpiceUsbDeviceManager  *self,
>              break;
>          }
>      }
> -    if (!device)
> +
> +    if (!device) {
> +        g_warning("Could not find USB device to remove at busnum %d devaddr %d",
> +                  bus, address);
>          return;
> +    }
>
>      spice_usb_device_manager_disconnect_device(self, (SpiceUsbDevice *)device);
>
>