Blob Blame History Raw
From 81c96df492e8f8b01640634fcd79234f63f5228e Mon Sep 17 00:00:00 2001
From: Hans de Goede <hdegoede@redhat.com>
Date: Tue, 13 Aug 2013 12:19:54 +0200
Subject: [PATCH 36/36] vdagent-x11: Turn some error messages into debugging
 messages (rhbz#918310)

Some bad clients, ie autocutsel, don't stick to the icccm spec, causing us to
flood the logs with error messages, turn these into debug messages instead,
so that they are only shown when debuggging / verbose logging is turned on.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
(cherry picked from commit d39230cee236bc6b8b150c7687d49a46f519bd2b)
---
 src/vdagent-x11.c | 11 ++++++-----
 1 file changed, 6 insertions(+), 5 deletions(-)

diff --git a/src/vdagent-x11.c b/src/vdagent-x11.c
index e72fd24..c925b43 100644
--- a/src/vdagent-x11.c
+++ b/src/vdagent-x11.c
@@ -761,8 +761,8 @@ static uint32_t vdagent_x11_target_to_type(struct vdagent_x11 *x11,
         }
     }
 
-    SELPRINTF("unexpected selection type %s",
-              vdagent_x11_get_atom_name(x11, target));
+    VSELPRINTF("unexpected selection type %s",
+               vdagent_x11_get_atom_name(x11, target));
     return VD_AGENT_CLIPBOARD_NONE;
 }
 
@@ -834,7 +834,8 @@ static void vdagent_x11_handle_selection_notify(struct vdagent_x11 *x11,
     type = vdagent_x11_target_to_type(x11, selection,
                                       x11->conversion_req->target);
     if (type == VD_AGENT_CLIPBOARD_NONE)
-        syslog(LOG_ERR, "internal error conversion_req has bad target");
+        SELPRINTF("internal error conversion_req has bad target %s",
+                  vdagent_x11_get_atom_name(x11, x11->conversion_req->target));
     if (len == 0) { /* No errors so far */
         len = vdagent_x11_get_selection(x11, event, selection,
                                         x11->conversion_req->target,
@@ -1064,7 +1065,7 @@ static void vdagent_x11_handle_selection_request(struct vdagent_x11 *x11)
     type = vdagent_x11_target_to_type(x11, selection,
                                       event->xselectionrequest.target);
     if (type == VD_AGENT_CLIPBOARD_NONE) {
-        syslog(LOG_ERR, "guest app requested a non-advertised target");
+        VSELPRINTF("guest app requested a non-advertised target");
         vdagent_x11_send_selection_notify(x11, None, NULL);
         return;
     }
@@ -1310,7 +1311,7 @@ void vdagent_x11_clipboard_release(struct vdagent_x11 *x11, uint8_t selection)
     }
 
     if (x11->clipboard_owner[selection] != owner_client) {
-        SELPRINTF("received release while not owning client clipboard");
+        VSELPRINTF("received release while not owning client clipboard");
         return;
     }
 
-- 
2.20.1