From 364b81a70ea910181aed42b1708b2664906c6686 Mon Sep 17 00:00:00 2001 From: Christophe Fergeau Date: Mon, 20 Jul 2015 14:47:48 +0200 Subject: usbredir: Add a few debug logs Currently, spice-gtk debugging logs contain no traces of the values of the auto-redir/redir-on-connect filter, and it does not tell you about the vid/pid of the devices being connected/redirected. This commit adds the appropriate SPICE_DEBUG/CHANNEL_DEBUG calls so that this data is logged. --- src/channel-usbredir.c | 5 ++++- src/usb-device-manager.c | 12 ++++++++++-- 2 files changed, 14 insertions(+), 3 deletions(-) diff --git a/src/channel-usbredir.c b/src/channel-usbredir.c index 292b82f..89f5c9d 100644 --- a/src/channel-usbredir.c +++ b/src/channel-usbredir.c @@ -326,7 +326,10 @@ void spice_usbredir_channel_connect_device_async( g_return_if_fail(SPICE_IS_USBREDIR_CHANNEL(channel)); g_return_if_fail(device != NULL); - CHANNEL_DEBUG(channel, "connecting usb channel %p", channel); + CHANNEL_DEBUG(channel, "connecting device %04x:%04x (%p) to channel %p", + spice_usb_device_get_vid(spice_device), + spice_usb_device_get_pid(spice_device), + spice_device, channel); result = g_simple_async_result_new(G_OBJECT(channel), callback, user_data, spice_usbredir_channel_connect_device_async); diff --git a/src/usb-device-manager.c b/src/usb-device-manager.c index 12ad4ba..9792217 100644 --- a/src/usb-device-manager.c +++ b/src/usb-device-manager.c @@ -425,6 +425,7 @@ static void spice_usb_device_manager_set_property(GObject *gobject, break; } + SPICE_DEBUG("auto-connect filter set to %s", filter); free(priv->auto_conn_filter_rules); priv->auto_conn_filter_rules = rules; priv->auto_conn_filter_rules_count = count; @@ -449,6 +450,7 @@ static void spice_usb_device_manager_set_property(GObject *gobject, break; } + SPICE_DEBUG("redirect-on-connect filter set to %s", filter); free(priv->redirect_on_connect_rules); priv->redirect_on_connect_rules = rules; priv->redirect_on_connect_rules_count = count; @@ -885,7 +887,10 @@ static void spice_usb_device_manager_add_dev(SpiceUsbDeviceManager *self, spice_usb_device_ref(device)); } - SPICE_DEBUG("device added %p", device); + SPICE_DEBUG("device added %04x:%04x (%p)", + spice_usb_device_get_vid(device), + spice_usb_device_get_pid(device), + device); g_signal_emit(self, signals[DEVICE_ADDED], 0, device); } @@ -914,7 +919,10 @@ static void spice_usb_device_manager_remove_dev(SpiceUsbDeviceManager *self, spice_usb_device_manager_disconnect_device(self, device); - SPICE_DEBUG("device removed %p", device); + SPICE_DEBUG("device removed %04x:%04x (%p)", + spice_usb_device_get_vid(device), + spice_usb_device_get_pid(device), + device); spice_usb_device_ref(device); g_ptr_array_remove(priv->devices, device); g_signal_emit(self, signals[DEVICE_REMOVED], 0, device); -- cgit v1.2.3