]> xenbits.xensource.com Git - libvirt.git/commitdiff
virnetserver: Make pool job name less generic
authorJiri Denemark <jdenemar@redhat.com>
Fri, 26 Nov 2021 16:23:03 +0000 (17:23 +0100)
committerJiri Denemark <jdenemar@redhat.com>
Wed, 1 Dec 2021 13:36:30 +0000 (14:36 +0100)
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>
src/rpc/virnetserver.c

index d0f248e7f5690427c8a1cafefa398adf64f5a228..ad581a36ddf33c0bdf2b038c8acf781b086797a2 100644 (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;