[libvirt PATCH 4/4] virnetserver: Make pool job name less generic

Jiri Denemark jdenemar at redhat.com
Fri Nov 26 19:52:19 UTC 2021


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 at redhat.com>
---
 src/rpc/virnetserver.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/rpc/virnetserver.c b/src/rpc/virnetserver.c
index d0f248e7f5..ad581a36dd 100644
--- a/src/rpc/virnetserver.c
+++ b/src/rpc/virnetserver.c
@@ -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;
-- 
2.34.0




More information about the libvir-list mailing list