vdagent: udscs: limit retry to connect to vdagentd
This MR helps to limit the amount of logs when spice-vdagent is retrying the connection with spice-vdagentd; and also defines a maximum number of tries to connect to spice-vdagentd (60 times ~ 1 minute).
In case of failure, the logs are going to change from:
spice-vdagent[71001]: vdagent started
(spice-vdagent:71001): GLib-GIO-DEBUG: 19:27:42.463: _g_io_module_get_default: Found default implementation gvfs (GDaemonVfs) for ‘gio-vfs’
spice-vdagent[71001]: udscs_connect: Could not connect: No such file or directory
spice-vdagent[71001]: udscs_connect: Could not connect: No such file or directory
spice-vdagent[71001]: udscs_connect: Could not connect: No such file or directory
spice-vdagent[71001]: udscs_connect: Could not connect: No such file or directory
spice-vdagent[71001]: udscs_connect: Could not connect: No such file or directory
spice-vdagent[71001]: udscs_connect: Could not connect: No such file or directory
spice-vdagent[71001]: udscs_connect: Could not connect: No such file or directory
spice-vdagent[71001]: udscs_connect: Could not connect: No such file or directory
spice-vdagent[71001]: udscs_connect: Could not connect: No such file or directory
spice-vdagent[71001]: udscs_connect: Could not connect: No such file or directory
spice-vdagent[71001]: udscs_connect: Could not connect: No such file or directory
spice-vdagent[71001]: udscs_connect: Could not connect: No such file or directory
spice-vdagent[71001]: udscs_connect: Could not connect: No such file or directory
spice-vdagent[71001]: udscs_connect: Could not connect: No such file or directory
spice-vdagent[71001]: udscs_connect: Could not connect: No such file or directory
spice-vdagent[71001]: udscs_connect: Could not connect: No such file or directory
spice-vdagent[71001]: udscs_connect: Could not connect: No such file or directory
spice-vdagent[71001]: udscs_connect: Could not connect: No such file or directory
(...)
to
spice-vdagent[71415]: vdagent started
(spice-vdagent:71415): GLib-GIO-DEBUG: 19:28:53.450: _g_io_module_get_default: Found default implementation gvfs (GDaemonVfs) for ‘gio-vfs’
spice-vdagent[71415]: Failed to connect with spice-vdagentd due 'Could not connect: No such file or directory'. Trying again in 1s
spice-vdagent[71415]: Failed to connect to spice-vdagentd at /run/spice-vdagentd/spice-vdagent-sock (tried 60 times)
Edited by Victor Toso