virnetserver: Make pool job name less generic

The generic "rpc-worker" name becomes a name of the associated task,
which may than appear in logs and bring some confusion. Let's add a
server name to it so that one can easily see which daemon the task
belongs to, which is especially useful for split daemons. And since the
name would be too long, we can drop the "-worker" part and just keep it
as "rpc-*" and "prio-rpc-*".

Such confusing entries can, for example, be found in audit log when
SELinux is complaining that "rpc-worker" was denied access to something.

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
This commit is contained in:
Jiri Denemark 2021-11-26 17:23:03 +01:00
parent a8efdb4eed
commit b21b4b56f9

View File

@ -380,6 +380,7 @@ virNetServerNew(const char *name,
void *clientPrivOpaque)
{
g_autoptr(virNetServer) srv = NULL;
g_autofree char *jobName = g_strdup_printf("rpc-%s", name);
if (virNetServerInitialize() < 0)
return NULL;
@ -390,7 +391,7 @@ virNetServerNew(const char *name,
if (!(srv->workers = virThreadPoolNewFull(min_workers, max_workers,
priority_workers,
virNetServerHandleJob,
"rpc-worker",
jobName,
NULL,
srv)))
return NULL;