[PATCH 1/6] ch_driver: Don't lock driver when getting version

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxxxxxx>
---
 src/ch/ch_driver.c | 2 --
 1 file changed, 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;
 }
 
-- 
2.34.1




[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]

  Powered by Linux