mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-02-22 11:22:23 +00:00
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>
This commit is contained in:
parent
d192e522ef
commit
31ef66f12e
@ -106,9 +106,7 @@ static int chConnectGetVersion(virConnectPtr conn,
|
||||
if (virConnectGetVersionEnsureACL(conn) < 0)
|
||||
return -1;
|
||||
|
||||
chDriverLock(driver);
|
||||
*version = driver->version;
|
||||
chDriverUnlock(driver);
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user