]> xenbits.xensource.com Git - libvirt.git/commitdiff
ch_driver: Don't lock driver when getting version
authorMichal Privoznik <mprivozn@redhat.com>
Thu, 10 Feb 2022 14:28:47 +0000 (15:28 +0100)
committerMichal Privoznik <mprivozn@redhat.com>
Fri, 11 Feb 2022 09:46:49 +0000 (10:46 +0100)
In chConnectGetVersion() the CH driver is locked in order to read
driver->version. This is needless, because not only is the
version set with driver unlocked (chStateInitialize() calls
chExtractVersion() which sets the version), but the version is
practically immutable. Once driver initialized itself it's never
changed.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Tim Wiederhake <twiederh@redhat.com>
src/ch/ch_driver.c

index e751ddba19907c1b5624ed11d6a0db10cbe9fa46..7c3b45ca2f1e2bbd15863b24b7e9e24b18ef3e33 100644 (file)
@@ -106,9 +106,7 @@ static int chConnectGetVersion(virConnectPtr conn,
     if (virConnectGetVersionEnsureACL(conn) < 0)
         return -1;
 
-    chDriverLock(driver);
     *version = driver->version;
-    chDriverUnlock(driver);
     return 0;
 }