vdagent silently exiting when port file missing
When starting the user vdagent with the port file is missing, the vdagent is exiting silently, even with debug flags:
$ file /dev/virtio-ports/com.redhat.spice.0
/dev/virtio-ports/com.redhat.spice.0: cannot open `/dev/virtio-ports/com.redhat.spice.0' (No such file or directory)
$ src/spice-vdagent -x -dd
$ echo $?
0
Launching it with G_MESSAGES_DEBUG=all
prints the expected message:
$ G_MESSAGES_DEBUG=all src/spice-vdagent -x -dd
** (spice-vdagent:13319): DEBUG: 09:23:51.025: vdagent virtio channel /dev/virtio-ports/com.redhat.spice.0 does not exist, exiting
This behavior comes from this patch: vdagent: Silently ignore missing spicevmc device so it is not a bug, but I wonder if we could not rather have something like if (debug) log_something_on_terminal()
to have it more explicit, or somehow if (debug) G_MESSAGES_DEBUG=all
.
if (!g_file_test(portdev, G_FILE_TEST_EXISTS)) {
g_debug("vdagent virtio channel %s does not exist, exiting", portdev);
g_free(orig_argv);
return 0;
}