[Spice-devel] [PATCH spice-vdagent v5 2/2] file-xfer: change error log messages

Jakub Janků janku.jakub.jj at gmail.com
Wed May 24 14:45:40 UTC 2017


Add prefix "file-xfer #id" prefix to log message in send_file_xfer_status(),
so the message doesn't have to include file-xfer task id and it's always clear,
what task is the message concerning.
---
 src/vdagentd/vdagentd.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/src/vdagentd/vdagentd.c b/src/vdagentd/vdagentd.c
index 013b710..73b892f 100644
--- a/src/vdagentd/vdagentd.c
+++ b/src/vdagentd/vdagentd.c
@@ -325,7 +325,7 @@ static void send_file_xfer_status(struct vdagent_virtio_port *vport,
         memcpy(status->data, data, data_size);
 
     if (msg)
-        syslog(LOG_WARNING, msg, id);
+        syslog(LOG_WARNING, "file-xfer %u: %s", id, msg);
 
     if (vport)
         vdagent_virtio_port_write(vport, VDP_CLIENT_PORT,
@@ -348,14 +348,14 @@ static void do_client_file_xfer(struct vdagent_virtio_port *vport,
         if (!active_session_conn) {
             send_file_xfer_status(vport,
                "Could not find an agent connection belonging to the "
-               "active session, cancelling client file-xfer request %u",
+               "active session, cancelling file-xfer",
                s->id, VD_AGENT_FILE_XFER_STATUS_CANCELLED, NULL, 0);
             return;
         } else if (session_info_session_is_locked(session_info)) {
             syslog(LOG_DEBUG, "Session is locked, skipping file-xfer-start");
             send_file_xfer_status(vport,
                "User's session is locked and cannot start file transfer. "
-               "Cancelling client file-xfer request %u",
+               "Cancelling file-xfer",
                s->id, VD_AGENT_FILE_XFER_STATUS_ERROR, NULL, 0);
             return;
         }
@@ -826,7 +826,7 @@ static gboolean remove_active_xfers(gpointer key, gpointer value, gpointer conn)
 {
     if (value == conn) {
         send_file_xfer_status(virtio_port,
-                              "Agent disc; cancelling file-xfer %u",
+                              "Agent disc; cancelling file-xfer",
                               GPOINTER_TO_UINT(key),
                               VD_AGENT_FILE_XFER_STATUS_CANCELLED, NULL, 0);
         return 1;
-- 
2.13.0



More information about the Spice-devel mailing list