summaryrefslogtreecommitdiff
path: root/src/ch
diff options
context:
space:
mode:
authorMichal Privoznik <mprivozn@redhat.com>2022-02-10 15:28:47 +0100
committerMichal Privoznik <mprivozn@redhat.com>2022-02-11 10:46:49 +0100
commit31ef66f12ec8316125e0894604e707d8f3eb5f2f (patch)
treea997cf9a5cf88fcd5445f602f648f82a19413f7b /src/ch
parentd192e522ef42c498d655756a383e20f8294c1e2d (diff)
downloadlibvirt-31ef66f12ec8316125e0894604e707d8f3eb5f2f.tar.gz
ch_driver: Don't lock driver when getting version
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>
Diffstat (limited to 'src/ch')
-rw-r--r--src/ch/ch_driver.c2
1 files changed, 0 insertions, 2 deletions
diff --git a/src/ch/ch_driver.c b/src/ch/ch_driver.c
index e751ddba19..7c3b45ca2f 100644
--- a/src/ch/ch_driver.c
+++ b/src/ch/ch_driver.c
@@ -106,9 +106,7 @@ static int chConnectGetVersion(virConnectPtr conn,
if (virConnectGetVersionEnsureACL(conn) < 0)
return -1;
- chDriverLock(driver);
*version = driver->version;
- chDriverUnlock(driver);
return 0;
}