]> git.ipfire.org Git - thirdparty/libvirt.git/commit
log error if virConnectCacheOnceInit() fails
authorLaine Stump <laine@redhat.com>
Tue, 26 Jan 2021 04:54:57 +0000 (23:54 -0500)
committerLaine Stump <laine@redhat.com>
Tue, 2 Feb 2021 05:27:27 +0000 (00:27 -0500)
commit65ce8a424fe54928a6d859ff05afc140fef9af98
treedcd68337a599c5bee372fd3e8101f5dc8cd6c5b6
parent31d1835428004add9f58b0ac03715263ad869858
log error if virConnectCacheOnceInit() fails

virGetConnectNetwork() calls
 virGetConnectGeneric(), which calls
  virConnecCacheInitialize(), which is actually a call (only once) to
   virConnectCacheOnceInit() which calls
    virThreadLocalInit() several times, which calls
     pthread_key_create()

If pthread_key_create() fails, it (of course) doesn't log an error
(because it's not a part of libvirt), nor does any other function on
the call chain all the way up to virGetConnectNetwork(). But none of
the callers of virGetConnectNetwork() log an error either, so it is
possible that an API could fail due to virGetConnectNetwork() failing,
but would only log "an error was encountered, but the cause is
unknown. Deal with it."  (paraphrasing).

(In all likelyhood, virConnectCacheOnceInit() is going to be called at
some earlier time, and almost certainly pthread_key_create() will
never fail (and if it does, the user will have *much* bigger problems
than an obtuse error message from libvirt)).

Signed-off-by: Laine Stump <laine@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
src/driver.c