To reproduce the issue, start virtqemud with polkit auth enabled while
looking at the logs. Run a virsh command which will ask for
authentication.
After providing the password CTRL+C the virsh instance.
Any subsequent connection will get stuck
---
src/rpc/virnetserver.c | 26 ++++++++++++++++++++++++--
src/rpc/virnetserverclient.c | 2 ++
2 files changed, 26 insertions(+), 2 deletions(-)
diff --git a/src/rpc/virnetserver.c b/src/rpc/virnetserver.c
index a6c6443c55..f5f50464a2 100644
--- a/src/rpc/virnetserver.c
+++ b/src/rpc/virnetserver.c
@@ -821,8 +821,30 @@ void
virNetServerSetClientAuthenticated(virNetServer *srv,
virNetServerClient *client)
{
- VIR_LOCK_GUARD server_lock = virObjectLockGuard(srv);
- VIR_LOCK_GUARD client_lock = virObjectLockGuard(client);
+ VIR_LOCK_GUARD server_lock;
+ VIR_LOCK_GUARD client_lock;
+
+ printf("\n\n\n!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!\n");
+ printf(" kill virsh now; waiting 10 s\n");
+ printf("!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!\n");
+
+ sleep(10);
+
+ printf("\n\n\n!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!\n");
+ printf(" continuing\n");
+ printf("!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!\n");
+
+ server_lock = virObjectLockGuard(srv);
+
+ printf("\n\n\n!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!\n");
+ printf(" srv lokced\n");
+ printf("!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!\n");
+
+ client_lock = virObjectLockGuard(client);
+
+ printf("\n\n\n!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!\n");
+ printf(" client lokced\n");
+ printf("!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!\n");
virNetServerClientSetAuthLocked(client, VIR_NET_SERVER_SERVICE_AUTH_NONE);
virNetServerSetClientAuthCompletedLocked(srv, client);
diff --git a/src/rpc/virnetserverclient.c b/src/rpc/virnetserverclient.c
index 355aab4b04..bfdf121243 100644
--- a/src/rpc/virnetserverclient.c
+++ b/src/rpc/virnetserverclient.c
@@ -1013,6 +1013,8 @@ virNetServerClientCloseLocked(virNetServerClient *client)
if (client->sock) {
g_clear_pointer(&client->sock, virObjectUnref);
}
+
+ VIR_DEBUG("client closed");
}
--
2.43.0