[RFC/POC PATCH vd_agent 14/16] Improve/add some logging messages

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Signed-off-by: Lukáš Hrázký <lhrazky@xxxxxxxxxx>
---
 src/vdagent/vdagent.c   |  2 ++
 src/vdagent/x11-randr.c | 23 +++++++++++++++--------
 src/vdagentd/uinput.c   |  4 ++--
 3 files changed, 19 insertions(+), 10 deletions(-)

diff --git a/src/vdagent/vdagent.c b/src/vdagent/vdagent.c
index 3f8ef31..c5e5952 100644
--- a/src/vdagent/vdagent.c
+++ b/src/vdagent/vdagent.c
@@ -449,6 +449,8 @@ int main(int argc, char *argv[])
     if (do_daemonize)
         parent_socket = daemonize();
 
+    syslog(LOG_INFO, "vdagent started");
+
 #ifdef WITH_GTK
     gdk_set_allowed_backends("x11");
     gtk_init(NULL, NULL);
diff --git a/src/vdagent/x11-randr.c b/src/vdagent/x11-randr.c
index 84c75f2..abcb91b 100644
--- a/src/vdagent/x11-randr.c
+++ b/src/vdagent/x11-randr.c
@@ -711,14 +711,14 @@ static void dump_monitors_config(struct vdagent_x11 *x11,
     int i;
     VDAgentMonConfig *m;
 
-    syslog(LOG_DEBUG, "%s: %d, %x", prefix, mon_config->num_of_monitors,
+    syslog(LOG_DEBUG, "Monitors config %s: %d, %x", prefix, mon_config->num_of_monitors,
            mon_config->flags);
     for (i = 0 ; i < mon_config->num_of_monitors; ++i) {
         m = &mon_config->monitors[i];
         if (!monitor_enabled(m))
             continue;
-        syslog(LOG_DEBUG, "received monitor %d config %dx%d+%d+%d", i,
-               m->width, m->height, m->x, m->y);
+        syslog(LOG_DEBUG, "    monitor %d, config %dx%d+%d+%d",
+               i, m->width, m->height, m->x, m->y);
     }
 }
 
@@ -823,8 +823,7 @@ void vdagent_x11_set_monitor_config(struct vdagent_x11 *x11,
 
         if ((x + width > primary_w) || (y + height > primary_h)) {
             if (x11->debug)
-                syslog(LOG_DEBUG, "Disabling monitor %d: "
-                       "%dx%d+%d+%d > (%d,%d)",
+                syslog(LOG_DEBUG, "Disabling monitor %d: %dx%d+%d+%d > (%d,%d)",
                        i, width, height, x, y, primary_w, primary_h);
 
             xrandr_disable_output(x11, i);
@@ -876,6 +875,12 @@ void vdagent_x11_set_monitor_config(struct vdagent_x11 *x11,
         height = mon_config->monitors[i].height;
         x = mon_config->monitors[i].x;
         y = mon_config->monitors[i].y;
+
+        if (x11->debug) {
+            syslog(LOG_DEBUG, "Setting resolution for monitor %d: %dx%d+%d+%d)",
+                   i, width, height, x, y);
+        }
+
         if (!xrandr_add_and_set(x11, i, x, y, width, height) &&
                 enabled_monitors(mon_config) == 1) {
             set_screen_to_best_size(x11, width, height,
@@ -979,9 +984,11 @@ no_info:
     }
 
     if (x11->debug) {
-        for (i = 0; i < screen_count; i++)
-            syslog(LOG_DEBUG, "Screen %d %dx%d%+d%+d", i, res[i].width,
-                   res[i].height, res[i].x, res[i].y);
+        syslog(LOG_DEBUG, "Sending guest screen resolutions to vdagentd:");
+        for (i = 0; i < screen_count; i++) {
+            syslog(LOG_DEBUG, "   screen %d %dx%d%+d%+d", i,
+                   res[i].width, res[i].height, res[i].x, res[i].y);
+        }
     }
 
     udscs_write(x11->vdagentd, VDAGENTD_GUEST_XORG_RESOLUTION, width, height,
diff --git a/src/vdagentd/uinput.c b/src/vdagentd/uinput.c
index e2966c4..671ba81 100644
--- a/src/vdagentd/uinput.c
+++ b/src/vdagentd/uinput.c
@@ -99,9 +99,9 @@ void vdagentd_uinput_update_size(struct vdagentd_uinput **uinputp,
     int i, rc;
 
     if (uinput->debug) {
-        syslog(LOG_DEBUG, "uinput-update-size: %dx%d", width, height);
+        syslog(LOG_DEBUG, "updating uinput size to %dx%d, screen positions:", width, height);
         for (i = 0; i < screen_count; i++)
-            syslog(LOG_DEBUG, "screen %d: +%d+%d", i, screen_info[i].x,
+            syslog(LOG_DEBUG, "   screen %d: +%d+%d", i, screen_info[i].x,
                    screen_info[i].y);
     }
 
-- 
2.17.1

_______________________________________________
Spice-devel mailing list
Spice-devel@xxxxxxxxxxxxxxxxxxxxx
https://lists.freedesktop.org/mailman/listinfo/spice-devel




[Index of Archives]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Security]     [Bugtraq]     [Linux]     [Linux OMAP]     [Linux MIPS]     [ECOS]     [Asterisk Internet PBX]     [Linux API]     [Monitors]